UNPKG

@gitlab/ui

Version:
13 lines (9 loc) 1.92 kB
import examples from './examples'; var description = "## Usage\n\nThe dropdown component offers a user multiple items or actions to choose from which are initially\ncollapsed behind a button.\n\n### Icon-only dropdown\n\nIcon-only dropdowns must have an accessible name.\nYou can provide this with the combination of `text` and `text-sr-only` props.\n\nOptionally, you can use `no-caret` to remove the caret and `category=\"tertiary\"` to remove the border.\n\n```html\n<gl-dropdown\n icon=\"ellipsis_v\"\n text=\"More actions\"\n :text-sr-only=\"true\"\n category=\"tertiary\"\n no-caret\n>\n```\n\n### Button Content\n\nThere are 3 ways to set the dropdown button's content.\n\n1. Use the `text` attribute. This will display the text with the loading spinner (shown with the\n`loading` attribute), icon (if provided by the `icon` attribute), and dropdown caret:\n\n ```html\n <gl-dropdown text=\"Button text\">\n ```\n\n1. Use the `button-text` template. This allows custom content for the button's text, but keeps the\nloading spinner, icon, and dropdown caret:\n\n ```html\n <gl-dropdown>\n <template #button-text>\n <!-- Loading spinner shown here -->\n <!-- Icon shown here -->\n Custom <strong>Content</strong> with <em>HTML</em> via Slot\n <gl-truncate position=\"middle\" text=\"Truncated button text\"/>\n <!-- Dropdown arrow shown here -->\n </template>\n </gl-dropdown>\n ```\n\n1. Use the `button-content` template. This will replace everything in the button with the template:\n\n ```html\n <gl-dropdown>\n <template #button-content>\n Custom <strong>Content</strong> with <em>HTML</em> via Slot\n </template>\n </gl-dropdown>\n ```\n"; var dropdown_documentation = { description, bootstrapComponent: 'b-dropdown', examples, followsDesignSystem: false }; export default dropdown_documentation;