Components

Title

<Title />

Constructor

# <Title />

Summary is a story element. The look of the Title can be changed using the render prop titleElementRender. In case titleElementRender is passed in the config, it is rendered. Otherwise a default Title is rendered.

Parameters:
Name Type Description
params Object

object containing parameters passed to the render prop

story Object

story object

config Object

config object

element Object

the story element. This is same as the story element found in the story API response

...
ampRoutes(app, {
 render: {
   storyElementRender: {
     titleElementRender: ({ story, config, element }) => <MyCustomTitle story={story} config={config} storyElement={element} />
   }
 }
})
...

View Source atoms/story-elements/title/title.tsx, line 18

<Title />

Constructor

# <Title />

Unsupported element is displayed as a fallback if no other matching story element is found for the type | subtype. By default, if an element is unsupported, nothing is shown. However, the render prop unsupportedElementRender is passed, that will be shown

Parameters:
Name Type Description
params Object

object containing parameters passed to the render prop

story Object

story object

config Object

config object

element Object

the story element. This is same as the story element found in the story API response

...
ampRoutes(app, {
 render: {
   storyElementRender: {
     unsupportedElementRender: ({ story, config, element }) => <MyCustomUnsupportedElement story={story} config={config} storyElement={element} />
   }
 }
})
...

View Source atoms/story-elements/unsupported/unsupported.tsx, line 8