@salesforce/design-system-react
Version:
Salesforce Lightning Design System for React
1,174 lines (1,173 loc) • 790 kB
JSON
{
"accordion": {
"description": "An accordion allows a user to toggle the display of sections of content.\nThe accordion component wraps accordion panels that can be selected and expanded. It accepts children to define the content displayed within.",
"methods": [
{
"name": "onClickSummary",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
},
{
"name": "onKeyDownSummary",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "e",
"type": null
}
],
"returns": null
},
{
"name": "addSummaryButton",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "button",
"type": null
}
],
"returns": null
}
],
"props": {
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "CSS class names to be added to the accordion component. _Tested with snapshot testing._"
},
"id": {
"type": {
"name": "union",
"value": [
{
"name": "number"
},
{
"name": "string"
}
]
},
"required": false,
"description": "HTML id for accordion component. _Tested with snapshot testing._"
},
"children": {
"type": {
"name": "node"
},
"required": true,
"description": "The panel content for the Accordion component. Accordion panels should be added as <AccordionPanel />. Event handler for the accordion panels should be added to `<AccordionPanel />`. Optional `panelContentActions` component may be passed as prop. _Tested with Mocha framework and snapshot testing._\n\nExample:\n```\n<SLDSAccordion>\n <SLDSAccordionpanel />\n <SLDSAccordionpanel />\n <SLDSAccordionpanel />\n</SLDSAccordion>\n```"
}
},
"route": "accordions",
"display-name": "Accordions",
"SLDS-component-path": "/components/accordion",
"dependencies": [
{
"panel": {
"description": "The panel content for the Accordion component.",
"methods": [],
"props": {
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "The panel content for the Accordion component. Accordion panels should be added as <AccordionPanel />. Event handler for the accordion panels should be added to `<AccordionPanel />`. Optional `panelContentActions` component may be passed as prop. _Tested with Mocha framework and snapshot testing._"
},
"expanded": {
"type": {
"name": "bool"
},
"required": true,
"description": "Indicates whether item is expanded or not, which should be handled by `onTogglePanel`. _Tested with Mocha framework and snapshot testing._"
},
"id": {
"type": {
"name": "union",
"value": [
{
"name": "number"
},
{
"name": "string"
}
]
},
"required": true,
"description": "Id of the item belonging to this panel. _Tested with snapshot testing._"
},
"panelContentActions": {
"type": {
"name": "node"
},
"required": false,
"description": "Component that can be passed as prop to `<Panel />`. As an example, a menu dropdown could be used here to handle additional actions for each accordion panel. _Tested with Mocha framework._"
},
"onKeyDownSummary": {
"type": {
"name": "func"
},
"required": false,
"description": "Callback that will run whenever there is a keydown on the panel button. Function doesn't change the state of the component."
},
"onTogglePanel": {
"type": {
"name": "func"
},
"required": true,
"description": "Callback that will run whenever a panel is toggled. Function should handle state to toggle `expanded` prop. _Tested with Mocha framework._"
},
"refs": {
"type": {
"name": "shape",
"value": {
"summaryButton": {
"name": "func",
"required": false
}
}
},
"required": false,
"description": "Ref callback that will pass in panel's `input` tag"
},
"summary": {
"type": {
"name": "union",
"value": [
{
"name": "string"
},
{
"name": "node"
}
]
},
"required": true,
"description": "Summary in the span element in the header of this panel. The summary is truncated and so the title element should contain the full text so that it is accessible on hover. _Tested with snapshot testing._"
},
"title": {
"type": {
"name": "string"
},
"required": false,
"description": "HTML title attribute. _Tested with snapshot testing._"
}
},
"name": "panel",
"source": "/components/accordion/panel.jsx"
}
}
]
},
"alert": {
"description": "Alert banners communicate a state that affects the entire system, not just a feature or page. It persists over a session and appears without the user initiating the action. View [banner guidelines](https://www.lightningdesignsystem.com/guidelines/messaging/components/banners/).",
"methods": [
{
"name": "saveButtonRef",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "component",
"type": null
}
],
"returns": null
}
],
"props": {
"assistiveText": {
"type": {
"name": "shape",
"value": {
"closeButton": {
"name": "union",
"value": [
{
"name": "string"
},
{
"name": "node"
}
],
"required": false
}
}
},
"required": false,
"description": "**Assistive text for accessibility**\nThis object is merged with the default props object on every render.\n* `closeButton`: This is a visually hidden label for the close button.\n_Tested with snapshot testing._",
"defaultValue": {
"value": "{\n\tcloseButton: 'Close',\n}",
"computed": false
}
},
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "CSS classes to be added to tag with `.slds-notify_alert`. Uses `classNames` [API](https://github.com/JedWatson/classnames).\n_Tested with snapshot testing._"
},
"dismissible": {
"type": {
"name": "bool"
},
"required": false,
"description": "Allows user to click a close button. Banners should be dismissible only if they communicate future impact to the system,\n_Tested with snapshot testing._"
},
"icon": {
"type": {
"name": "node"
},
"required": false,
"description": "Icon of type `~/components/icon`. This icon will be cloned and additional props appended. The default icons are:\n* info variant: `utility:info`\n* error variant: `utility:error`\n* offline variant: `utility:offline`\n* warning variant: `utility:warning`\n\n_Tested with snapshot testing._"
},
"labels": {
"type": {
"name": "shape",
"value": {
"heading": {
"name": "union",
"value": [
{
"name": "string"
},
{
"name": "node"
}
],
"required": false
},
"headingLink": {
"name": "union",
"value": [
{
"name": "string"
},
{
"name": "node"
}
],
"required": false
}
}
},
"required": false,
"description": "**Text labels for internationalization**\nThis object is merged with the default props object on every render.\n* `heading`: text within heading tag\n* `headingLink`: Text of link that triggers `onClickHeadingLink`. Inline links should pass a keyed array of React components into `labels.heading`.\n\n_Tested with snapshot testing._",
"defaultValue": {
"value": "{}",
"computed": false
}
},
"onClickHeadingLink": {
"type": {
"name": "func"
},
"required": false,
"description": "Triggered by link. _Tested with Mocha testing._"
},
"onRequestClose": {
"type": {
"name": "func"
},
"required": false,
"description": "Triggered by close button. This is a controlled component. _Tested with Mocha testing._"
},
"style": {
"type": {
"name": "object"
},
"required": false,
"description": "Custom styles to be passed to the component. _Tested with Mocha testing._"
},
"variant": {
"type": {
"name": "enum",
"value": [
{
"value": "'error'",
"computed": false
},
{
"value": "'info'",
"computed": false
},
{
"value": "'offline'",
"computed": false
},
{
"value": "'warning'",
"computed": false
}
]
},
"required": false,
"description": "The type of alert. _Tested with snapshot testing._",
"defaultValue": {
"value": "'info'",
"computed": false
}
}
},
"route": "alerts",
"display-name": "Alerts",
"SLDS-component-path": "/components/alert",
"dependencies": [
{
"container": {
"description": "A fixed container for alert banners.",
"methods": [],
"props": {
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "CSS classes to be added to tag with `.slds-notify_alert`. Uses `classNames` [API](https://github.com/JedWatson/classnames)."
},
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "Alert components"
}
},
"name": "container",
"source": "/components/alert/container.jsx"
}
}
]
},
"app-launcher": {
"description": "The App Launcher allows the user to quickly access all the apps and functionality with their organization.\nThe App Launcher should generally only be used as a sub-component of the [Global Navigation Bar](/components/global-navigation-bar)\n\nUSAGE EXAMPLE:\n```\n<AppLauncher>\n\t<AppLauncherExpandableSection>\n\t\t<AppLauncherTile />\n\t\t<AppLauncherTile />\n\t\t<AppLauncherTile />\n\t</AppLauncherExpandableSection>\n\t<AppLauncherExpandableSection>\n\t\t<AppLauncherTile />\n\t\t<AppLauncherTile />\n\t</AppLauncherExpandableSection>\n</AppLauncher>\n```\n\nBy default, `Modal`, a child component of App Launcher, will add `aria-hidden=true` to the `body` tag, but this disables some assistive technologies. To prevent this you can add the following to your application with `#mount` being the root node of your application that you would like to hide from assistive technologies when the `Modal` is open.\n```\nimport settings from 'design-system-react/components/settings';\nsettings.setAppElement('#mount');\n```",
"methods": [
{
"name": "getId",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
},
{
"name": "openAppLauncher",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "event",
"type": null
}
],
"returns": null
},
{
"name": "closeAppLauncher",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "event",
"type": null
}
],
"returns": null
},
{
"name": "renderSearch",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
}
],
"props": {
"assistiveText": {
"type": {
"name": "shape",
"value": {
"trigger": {
"name": "string",
"required": false
}
}
},
"required": false,
"description": "**Assistive text for accessibility.**\nThis object is merged with the default props object on every render.\n* `trigger`: This is a visually hidden label for the app launcher icon.",
"defaultValue": {
"value": "{\n\ttrigger: 'Open App Launcher',\n}",
"computed": false
}
},
"ariaHideApp": {
"type": {
"name": "bool"
},
"required": false,
"description": "Boolean indicating if the appElement should be hidden.",
"defaultValue": {
"value": "true",
"computed": false
}
},
"children": {
"type": {
"name": "node"
},
"required": true,
"description": "One or more `<AppLauncherExpandableSection />`s, each containing one or more `<AppLauncherTile />`s or `<AppLauncherLink />`s"
},
"id": {
"type": {
"name": "string"
},
"required": false,
"description": "The app launcher id. If not provided, one will be generated for accessibility"
},
"isOpen": {
"type": {
"name": "bool"
},
"required": false,
"description": "Control the open/close state of the App Launcher"
},
"modalClassName": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "CSS classes to be added to App Launcher Modal."
},
"modalHeaderButton": {
"type": {
"name": "node"
},
"required": false,
"description": "Button that exists in the upper right hand corner of the App Launcher modal"
},
"noTruncate": {
"type": {
"name": "bool"
},
"required": false,
"description": "Allows longer application names without truncating them."
},
"onClose": {
"type": {
"name": "func"
},
"required": false,
"description": "Callback when the App Launcher Modal is closed"
},
"search": {
"type": {
"name": "node"
},
"required": false,
"description": "Search bar for the Modal's header. Will typically be an instance of `design-system-react/input/search`"
},
"title": {
"type": {
"name": "string"
},
"required": false,
"description": "Set the App Launcher's title text (for localization)",
"defaultValue": {
"value": "'App Launcher'",
"computed": false
}
},
"triggerName": {
"type": {
"name": "node"
},
"required": false,
"description": "This is typically the name of the cloud or application"
},
"triggerOnClick": {
"type": {
"name": "func"
},
"required": false,
"description": "Callback when the App Launcher icon is clicked"
}
},
"route": "app-launcher",
"display-name": "App Launcher",
"SLDS-component-path": "/components/app-launcher",
"dependencies": [
{
"expandable-section": {
"description": "App Launcher Sections allow users to categorize App Tiles & Links as well as toggle their display. It is a superset of components/expandable-section with content formatting.\nAll Expandable Section props are compatible with props passed to this component.",
"methods": [
{
"name": "toggleOpen",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "event",
"type": null
},
{
"name": "data",
"type": null
}
],
"returns": null
}
],
"props": {
"assistiveText": {
"type": {
"name": "shape",
"value": {
"toggleSection": {
"name": "string",
"required": false
}
}
},
"required": false,
"description": "**Assistive text for accessibility.**\n* `toggleSection`: Label for the icon that expands / collapses the section"
},
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "Contents of the section"
},
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "Class names to be added to the `slds-section` classed node"
},
"id": {
"type": {
"name": "string"
},
"required": false,
"description": "Unique identifier for the expandable section. The id is automatically generated if not provided"
},
"isOpen": {
"type": {
"name": "bool"
},
"required": false,
"description": "Specifies whether the section is expanded or collapsed. If not provided, component will use its own state to manage this itself"
},
"nonCollapsible": {
"type": {
"name": "bool"
},
"required": false,
"description": "Specifies whether the section can be expanded or collapsed. Defaults to `false`"
},
"onToggleOpen": {
"type": {
"name": "func"
},
"required": false,
"description": "Callback for when the section is expanded or collapsed. Passes event object and data object with `isOpen` bool."
},
"title": {
"type": {
"name": "string"
},
"required": true,
"description": "The title for the section"
}
},
"name": "expandable-section",
"source": "/components/app-launcher/expandable-section.jsx"
}
},
{
"link": {
"description": "App Launcher Link component creates simple links to be used in \"All Items\" sections",
"methods": [],
"props": {
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "Contents of the link"
},
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "Classes to be applied to the link"
},
"href": {
"type": {
"name": "string"
},
"required": false,
"description": "The `href` attribute of the link. If the `onClick` callback is specified this URL will be prevented from changing the browser's location.",
"defaultValue": {
"value": "'#'",
"computed": false
}
},
"onClick": {
"type": {
"name": "func"
},
"required": false,
"description": "Callback for when the link is clicked. Passes back event and data object with href prop. Prevents click from changing browser's location if set."
},
"search": {
"type": {
"name": "string"
},
"required": false,
"description": "Text used to highlight content in link"
},
"title": {
"type": {
"name": "string"
},
"required": false,
"description": "The title for the link. If not provided it will attempt to use child content if that content is a string."
}
},
"name": "link",
"source": "/components/app-launcher/link.jsx"
}
},
{
"tile": {
"description": "App Launcher Tiles provide information and links to a user's apps",
"methods": [
{
"name": "handleClick",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "event",
"type": null
}
],
"returns": null
}
],
"props": {
"assistiveText": {
"type": {
"name": "shape",
"value": {
"dragIconText": {
"name": "string",
"required": false
}
}
},
"required": false,
"description": "**Assistive text for accessibility.**\n* `dragIconText`: Text that describes the purpose of the drag handle icon.",
"defaultValue": {
"value": "{\n\tdragIconText: 'Reorder',\n}",
"computed": false
}
},
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "Class names to be added to the tile."
},
"description": {
"type": {
"name": "string"
},
"required": false,
"description": "The description of the app. Not visible on small tiles."
},
"descriptionHeading": {
"type": {
"name": "string"
},
"required": false,
"description": "Heading for app description. NOTE: this prop is DEPRECATED and use should be avoided"
},
"href": {
"type": {
"name": "string"
},
"required": false,
"description": "The `href` attribute of the tile. Please pass in bookmarkable URLs from your routing library. If the `onClick` callback is specified this URL will be prevented from changing the browser's location.",
"defaultValue": {
"value": "'#'",
"computed": false
}
},
"iconBackgroundColor": {
"type": {
"name": "string"
},
"required": false,
"description": "Background color to be used on the icon. Only applied if iconNode is undefined"
},
"iconNode": {
"type": {
"name": "node"
},
"required": false,
"description": "Icon node for app tile. Takes priority over `iconText`"
},
"iconText": {
"type": {
"name": "string"
},
"required": false,
"description": "Text to be used as an icon. Only renders if iconNode is undefined"
},
"isOpenTooltip": {
"type": {
"name": "bool"
},
"required": false,
"description": "Open the More Tooltip"
},
"moreLabel": {
"type": {
"name": "string"
},
"required": false,
"description": "The localized text for the \"More information\" tooltip.",
"defaultValue": {
"value": "' More'",
"computed": false
}
},
"onClick": {
"type": {
"name": "func"
},
"required": false,
"description": "Function that will be executed when clicking on a tile"
},
"search": {
"type": {
"name": "string"
},
"required": false,
"description": "Text used to highlight content in app tiles"
},
"title": {
"type": {
"name": "string"
},
"required": true,
"description": "App name for the tile's title."
}
},
"name": "tile",
"source": "/components/app-launcher/tile.jsx"
}
}
]
},
"avatar": {
"description": "The avatar component represents an object or entity. An image is the preferred format for an avatar.\n If the `imgSrc` prop is undefined, and if a `label` or `initials` prop is available, the fallback avatar will render with initials. If initals are passed in directly in the `initials` prop, this will render in the fallback avatar. If `initals` prop is unavailable but a `label` prop is available, the fallback avatar will render with built initials of the user name or entity name.\n\n Intials built from the `label` prop will apply the following logic: If the label name contains two words, like first and last name, the first letter of each will be capitalized and returned. For labels that only have a single word name, the first two letters of that word, using one capital and one lower case letter, will be returned. For labels that contain three or more words, the first character of the first and last words will be capitalized and returned.\n\n If `initials` or `label` are not available, the fallback avatar will render a standard icon. If `variant='user'`, a user icon will\n render. If `variant='entity'`, an account icon will render.",
"methods": [
{
"name": "buildInitials",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
},
{
"name": "handleImageError",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
},
{
"name": "renderBaseAvatar",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
},
{
"name": "renderIconAvatar",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
},
{
"name": "renderInitialsAvatar",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
}
],
"props": {
"assistiveText": {
"type": {
"name": "shape",
"value": {
"icon": {
"name": "string",
"required": false
}
}
},
"required": false,
"description": "**Assistive text for accessibility.**\nThis object is merged with the default props object on every render.\n* `icon`: Assistive text for accessibility that labels the icon.",
"defaultValue": {
"value": "{\n\ticon: 'User or Account Icon',\n}",
"computed": false
}
},
"imgAlt": {
"type": {
"name": "string"
},
"required": false,
"description": "Alt attribute to be applied to image (base case) element.",
"defaultValue": {
"value": "''",
"computed": false
}
},
"imgSrc": {
"type": {
"name": "string"
},
"required": false,
"description": "Source attribute to be applied to image (base case) element."
},
"initials": {
"type": {
"name": "string"
},
"required": false,
"description": "Initials attribute to optionally pass in initials directly in case of \"initials\" fallback case."
},
"inverse": {
"type": {
"name": "bool"
},
"required": false,
"description": "Avatar with initials that are dark text on light background"
},
"label": {
"type": {
"name": "string"
},
"required": false,
"description": "Label attibute to display inside \"initials\" fallback case. Will be passed as title prop in `abbr` element to provide more specificity."
},
"variant": {
"type": {
"name": "enum",
"value": [
{
"value": "'entity'",
"computed": false
},
{
"value": "'user'",
"computed": false
}
]
},
"required": false,
"description": "Avatar variants to apply relevant styling (circle: user, square: entity) and icon rendering if applicable.",
"defaultValue": {
"value": "'user'",
"computed": false
}
},
"size": {
"type": {
"name": "enum",
"value": [
{
"value": "'x-small'",
"computed": false
},
{
"value": "'small'",
"computed": false
},
{
"value": "'medium'",
"computed": false
},
{
"value": "'large'",
"computed": false
}
]
},
"required": false,
"description": "Size of the icon in \"icon\" fallback case.",
"defaultValue": {
"value": "'medium'",
"computed": false
}
},
"title": {
"type": {
"name": "string"
},
"required": false,
"description": "Title attribute for the avatar container.",
"defaultValue": {
"value": "'user avatar'",
"computed": false
}
}
},
"route": "avatars",
"display-name": "Avatars",
"SLDS-component-path": "/components/avatar",
"dependencies": []
},
"badge": {
"description": "Badges are labels which hold small amounts of information.",
"methods": [
{
"name": "getId",
"docblock": "Get the Badge's HTML id. Generate a new one if no ID present.",
"modifiers": [],
"params": [],
"returns": null,
"description": "Get the Badge's HTML id. Generate a new one if no ID present."
}
],
"props": {
"className": {
"type": {
"name": "union",
"value": [
{
"name": "array"
},
{
"name": "object"
},
{
"name": "string"
}
]
},
"required": false,
"description": "CSS classes that are applied to the component"
},
"id": {
"type": {
"name": "string"
},
"required": false,
"description": "Id of component, if desired. If not provided an id is automatically generated"
},
"style": {
"type": {
"name": "object"
},
"required": false,
"description": "Custom styles to be passed to the component"
},
"color": {
"type": {
"name": "enum",
"value": [
{
"value": "'default'",
"computed": false
},
{
"value": "'inverse'",
"computed": false
},
{
"value": "'light'",
"computed": false
},
{
"value": "'success'",
"computed": false
},
{
"value": "'warning'",
"computed": false
},
{
"value": "'error'",
"computed": false
}
]
},
"required": false,
"description": "Color variant for the badge component",
"defaultValue": {
"value": "'default'",
"computed": false
}
},
"iconAlignment": {
"type": {
"name": "enum",
"value": [
{
"value": "'left'",
"computed": false
},
{
"value": "'right'",
"computed": false
}
]
},
"required": false,
"description": "Icon alignment for the badge component",
"defaultValue": {
"value": "'left'",
"computed": false
}
},
"content": {
"type": {
"name": "union",
"value": [
{
"name": "string"
},
{
"name": "node"
}
]
},
"required": false,
"description": "Content to be placed inside the badge component"
}
},
"route": "badge",
"display-name": "Badge",
"SLDS-component-path": "/components/badges",
"dependencies": []
},
"brand-band": {
"description": "The brand band provides theming capability that adds personality and improves information density and contrast.",
"methods": [
{
"name": "getId",
"docblock": null,
"modifiers": [],
"params": [],
"returns": null
}
],
"props": {
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "Primary application grid layout or a white background component such as a `Card` should be passed into this component."
},
"className": {
"type": {
"name": "union",
"value": [
{