A row shows Story or Clip tiles in one horizontal line that users can scroll.
Use StorytellerStoriesRowView for Stories and StorytellerClipsRowView for
Clips. To show a row only when it has content, check
getStoriesCount or
getClipsCount first.
conststoryRow=newStoryteller.StorytellerStoriesRowView('stories-row-id');// All CategoriesconststoryRowWithCategories=newStoryteller.StorytellerStoriesRowView('stories-row-id',['category-1','category-2']);
The row sizes its tiles to the height of its container. Set a height on the container, for example <div id="stories-row-id" style="height: 200px"></div>. If the container has no height, the SDK uses a default tile height (160 px for square tiles, and 120 px or 140 px for round tiles, depending on whether titles show). When logging is enabled, the SDK also logs a warning.
Set a row's options with its configuration object. TypeScript examples
assume
import * as Storyteller from '@getstoryteller/storyteller-sdk-javascript';
and import type { IListConfiguration } from '@getstoryteller/storyteller-sdk-javascript';.
constcustomTheme=newStoryteller.UiTheme();// See Customize themesconstclipsRow=newStoryteller.StorytellerClipsRowView('clips-row-id','collection-id');clipsRow.configuration={displayLimit:10,theme:customTheme,uiStyle:Storyteller.UiStyle.dark,};clipsRow.cellType=Storyteller.CellType.round;// Clips rows set cellType on the view
constcustomTheme=newStoryteller.UiTheme();// See Customize themesconstclipsRow=newStoryteller.StorytellerClipsRowView('clips-row-id','collection-id');constclipsRowConfiguration:IListConfiguration<'StorytellerClipsRowView'>={displayLimit:10,theme:customTheme,uiStyle:Storyteller.UiStyle.dark,};clipsRow.configuration=clipsRowConfiguration;clipsRow.cellType=Storyteller.CellType.round;// Clips rows set cellType on the view
For Clips, the Storyteller Web Showcase's
StorytellerClipsRowView
builds the row configuration with the collection ID, display limit, and theme.
Rows accept every setting in Configure views, plus
the following:
cellType sets the tile shape: Storyteller.CellType.square (default) or
Storyteller.CellType.round.
On a Stories row, set it in configuration.
On a Clips row, set clipsRow.cellType. configuration doesn't accept cellType for Clips rows.
On either row, you can instead add data-cell-type="round" to the container.
{"slug": "storyteller-row-view", "page_title": "Add a Story or Clips Row", "page_url": "StorytellerRowView/", "canonical_url": "/web/StorytellerRowView/", "markdown": "# Add a Story or Clips row {#configuring-a-storytellerstoriesrowview}\n\nA row shows Story or Clip tiles in one horizontal line that users can scroll.\nUse `StorytellerStoriesRowView` for Stories and `StorytellerClipsRowView` for\nClips. To show a row only when it has content, check\n[`getStoriesCount`](AdditionalMethods.md#getstoriescount) or\n[`getClipsCount`](AdditionalMethods.md#getclipscount) first.\n\n## Initialization\n\nCreate the row with the ID of an existing element on your page. Rows take the\nsame arguments as the other views in\n[Configure views](StorytellerListView.md#initialization):\n\n### Stories initialization\n\n```javascript\nconst storyRow = new Storyteller.StorytellerStoriesRowView('stories-row-id'); // All Categories\nconst storyRowWithCategories = new Storyteller.StorytellerStoriesRowView(\n 'stories-row-id',\n ['category-1', 'category-2']\n);\n```\n\n### Clips initialization\n\n```javascript\nconst clipsRow = new Storyteller.StorytellerClipsRowView(\n 'clips-row-id',\n 'clip-collection-id'\n);\n```\n\n!!! note\n\n The row sizes its tiles to the height of its container. Set a height on the container, for example `<div id=\"stories-row-id\" style=\"height: 200px\"><\/div>`. If the container has no height, the SDK uses a default tile height (160 px for square tiles, and 120 px or 140 px for round tiles, depending on whether titles show). When logging is enabled, the SDK also logs a warning.\n\n## Configuration\n\nSet a row's options with its `configuration` object. TypeScript examples\nassume\n`import * as Storyteller from '@getstoryteller/storyteller-sdk-javascript';`\nand `import type { IListConfiguration } from '@getstoryteller/storyteller-sdk-javascript';`.\n\n### Stories configuration\n\n=== \"JavaScript\"\n\n ```javascript\n const customTheme = new Storyteller.UiTheme(); // See Customize themes\n const storyRow = new Storyteller.StorytellerStoriesRowView('stories-row-id');\n storyRow.configuration = {\n categories: ['category1', 'category2', 'category3'], // Stories only\n cellType: Storyteller.CellType.round, // StorytellerStoriesRowView only\n displayLimit: 10,\n preload: true, // Stories only\n theme: customTheme,\n uiStyle: Storyteller.UiStyle.dark,\n };\n ```\n\n=== \"TypeScript\"\n\n ```typescript\n const customTheme = new Storyteller.UiTheme(); // See Customize themes\n const storyRow = new Storyteller.StorytellerStoriesRowView('stories-row-id');\n const storyRowConfiguration: IListConfiguration<'StorytellerStoriesRowView'> = {\n categories: ['category1', 'category2', 'category3'], // Stories only\n cellType: Storyteller.CellType.round, // StorytellerStoriesRowView only\n displayLimit: 10,\n preload: true, // Stories only\n theme: customTheme,\n uiStyle: Storyteller.UiStyle.dark,\n };\n storyRow.configuration = storyRowConfiguration;\n ```\n\nFor a working React component that applies these options, see the Storyteller\nWeb Showcase's\n[`StorytellerStoriesRowView`](https://github.com/getstoryteller/storyteller-showcase-web/blob/11.0.0/nextjs/src/components/atoms/StorytellerRenderers/StorytellerStoriesRowView.tsx#L61-L85).\n\n### Clips configuration\n\n=== \"JavaScript\"\n\n ```javascript\n const customTheme = new Storyteller.UiTheme(); // See Customize themes\n const clipsRow = new Storyteller.StorytellerClipsRowView(\n 'clips-row-id',\n 'collection-id'\n );\n clipsRow.configuration = {\n displayLimit: 10,\n theme: customTheme,\n uiStyle: Storyteller.UiStyle.dark,\n };\n clipsRow.cellType = Storyteller.CellType.round; // Clips rows set cellType on the view\n ```\n\n=== \"TypeScript\"\n\n ```typescript\n const customTheme = new Storyteller.UiTheme(); // See Customize themes\n const clipsRow = new Storyteller.StorytellerClipsRowView(\n 'clips-row-id',\n 'collection-id'\n );\n const clipsRowConfiguration: IListConfiguration<'StorytellerClipsRowView'> = {\n displayLimit: 10,\n theme: customTheme,\n uiStyle: Storyteller.UiStyle.dark,\n };\n clipsRow.configuration = clipsRowConfiguration;\n clipsRow.cellType = Storyteller.CellType.round; // Clips rows set cellType on the view\n ```\n\nFor Clips, the Storyteller Web Showcase's\n[`StorytellerClipsRowView`](https://github.com/getstoryteller/storyteller-showcase-web/blob/11.0.0/nextjs/src/components/atoms/StorytellerRenderers/StorytellerClipsRowView.tsx#L62)\nbuilds the row configuration with the collection ID, display limit, and theme.\n\nRows accept every setting in [Configure views](StorytellerListView.md), plus\nthe following:\n\n#### cellType\n\n`cellType` sets the tile shape: `Storyteller.CellType.square` (default) or\n`Storyteller.CellType.round`.\n\n- On a Stories row, set it in `configuration`.\n- On a Clips row, set `clipsRow.cellType`. `configuration` doesn't accept `cellType` for Clips rows.\n- On either row, you can instead add `data-cell-type=\"round\"` to the container.\n", "copy_markdown_include_header": false, "base_path": "", "ai_dir": "ai", "missing_payload_behavior": "empty"}