[ { "component": "RelativeTime", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/relative_time.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/relative_time/default/", "parameters": [ { "name": "datetime", "type": "Time", "default": "N/A", "description": "The time to be formatted." }, { "name": "tense", "type": "Symbol", "default": "`:auto`", "description": "Which tense to use. One of `:auto`, `:future`, or `:past`." }, { "name": "prefix", "type": "sring", "default": "`nil`", "description": "What to prefix the relative ime display with." }, { "name": "second", "type": "Symbol", "default": "`SECOND_DEFAULT`", "description": "What format seconds should take. One of `nil`, `:numeric`, or `:two_digit`." }, { "name": "minute", "type": "Symbol", "default": "`MINUTE_DEFAULT`", "description": "What format minues should take. One of `nil`, `:numeric`, or `:two_digit`." }, { "name": "hour", "type": "Symbol", "default": "`HOUR_DEFAULT`", "description": "What format hours should take. One of `nil`, `:numeric`, or `:two_digit`." }, { "name": "weekday", "type": "Symbol", "default": "`WEEKDAY_DEFAULT`", "description": "What format weekdays should take. One of `nil`, `:long`, `:narrow`, or `:short`." }, { "name": "day", "type": "Symbol", "default": "`DAY_DEFAULT`", "description": "What format days should take. One of `nil`, `:numeric`, or `:two_digit`." }, { "name": "month", "type": "Symbol", "default": "`MONTH_DEFAULT`", "description": "What format months should take. One of `nil`, `:long`, `:narrow`, `:numeric`, `:short`, or `:two_digit`." }, { "name": "year", "type": "Symbol", "default": "`YEAR_DEFAULT`", "description": "What format years should take. One of `nil`, `:numeric`, or `:two_digit`." }, { "name": "time_zone_name", "type": "Symbol", "default": "`TIMEZONENAME_DEFAULT`", "description": "What format the time zone should take. One of `nil`, `:long`, `:long_generic`, `:long_offset`, `:short`, `:short_generic`, or `:short_offset`." }, { "name": "threshold", "type": "string", "default": "`nil`", "description": "The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute." }, { "name": "precision", "type": "Symbol", "default": "`PRECISION_DEFAULT`", "description": "The precision elapsed time should display. One of `nil`, `:day`, `:hour`, `:minute`, `:month`, `:second`, or `:year`." }, { "name": "format", "type": "Symbol", "default": "`nil`", "description": "The format the display should take. One of `:auto`, `:elapsed`, or `:micro`." }, { "name": "format_style", "type": "Symbol", "default": "`nil`", "description": "The format the display should take. One of `nil`, `:long`, `:narrow`, or `:short`." }, { "name": "lang", "type": "string", "default": "`nil`", "description": "The language to use." }, { "name": "title", "type": "string", "default": "`nil`", "description": "Provide a custom title to the element." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "IconButton", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/icon_button.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/icon_button/default/", "parameters": [ { "name": "icon", "type": "String", "default": "N/A", "description": "Name of [Octicon](https://primer.style/octicons/) to use." }, { "name": "wrapper_arguments", "type": "Hash", "default": "`{}`", "description": "Optional keyword arguments to be passed to the wrapper `
` tag." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:danger`, `:default`, or `:invisible`." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:large`, `:medium`, or `:small`." }, { "name": "tag", "type": "Symbol", "default": "N/A", "description": "One of `:a`, `:button`, or `:summary`." }, { "name": "type", "type": "Symbol", "default": "N/A", "description": "One of `:button`, `:reset`, or `:submit`." }, { "name": "aria-label", "type": "String", "default": "N/A", "description": "String that can be read by assistive technology. A label should be short and concise. See the accessibility section for more information." }, { "name": "aria-description", "type": "String", "default": "N/A", "description": "String that can be read by assistive technology. A description can be longer as it is intended to provide more context and information. See the accessibility section for more information." }, { "name": "show_tooltip", "type": "Boolean", "default": "`true`", "description": "Whether or not to show a tooltip when this button is hovered. Tooltips should only be hidden if the aria label is redundant, i.e. if the icon has a widely understood definition." }, { "name": "tooltip_direction", "type": "Symbol", "default": "`:s`", "description": "One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Button", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/button.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button/default/", "parameters": [ { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:danger`, `:default`, `:invisible`, `:link`, `:primary`, or `:secondary`." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:large`, `:medium`, or `:small`." }, { "name": "block", "type": "Boolean", "default": "`false`", "description": "Whether button is full-width with `display: block`." }, { "name": "align_content", "type": "Symbol", "default": "`:center`", "description": "One of `:center` or `:start`." }, { "name": "tag", "type": "Symbol", "default": "`:button`", "description": "One of `:a`, `:button`, or `:summary`." }, { "name": "type", "type": "Symbol", "default": "`:button`", "description": "One of `:button`, `:reset`, or `:submit`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "SegmentedControl", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/segmented_control.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/segmented_control/default/", "parameters": [ { "name": "hide_labels", "type": "Boolean", "default": "`false`", "description": "Whether to hide the labels and only show the icons" }, { "name": "full_width", "type": "Boolean", "default": "`false`", "description": "If the component should be full width" }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:large`, `:medium`, or `:small`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Layout", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/layout.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/layout/default/", "parameters": [ { "name": "stacking_breakpoint", "type": "Symbol", "default": "`:md`", "description": "When the `Layout` should change from rows into columns. One of `:lg`, `:md`, or `:sm`." }, { "name": "first_in_source", "type": "Symbol", "default": "`:sidebar`", "description": "Which element to render first in the HTML. This will change the keyboard navigation order. One of `:main` or `:sidebar`." }, { "name": "gutter", "type": "Symbol", "default": "`:default`", "description": "The amount of space between the main section and the sidebar. One of `:condensed`, `:default`, `:none`, or `:spacious`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "HellipButton", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/hellip_button.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/hellip_button/default/", "parameters": [ { "name": "inline", "type": "Boolean", "default": "`false`", "description": "Whether or not the button is inline." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Image", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/image.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/image/default/", "parameters": [ { "name": "src", "type": "String", "default": "N/A", "description": "The source url of the image." }, { "name": "alt", "type": "String", "default": "N/A", "description": "Specifies an alternate text for the image." }, { "name": "lazy", "type": "Boolean", "default": "`false`", "description": "Whether or not to lazily load the image." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "OcticonSymbols", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/octicon_symbols.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/octicon_symbols/default/", "parameters": [ { "name": "icons", "type": "Array", "default": "`[]`", "description": "List of icons to render, in the format { symbol: :icon_name, size: :small }" } ] }, { "component": "ImageCrop", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/image_crop.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/image_crop/default/", "parameters": [ { "name": "src", "type": "String", "default": "N/A", "description": "The path of the image to crop." }, { "name": "rounded", "type": "Boolean", "default": "`true`", "description": "If the crop mask should be a circle. Defaults to true." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "IconButton", "status": "deprecated", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/icon_button.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/icon_button/default/", "parameters": [ { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:danger` or `:default`." }, { "name": "icon", "type": "String", "default": "N/A", "description": "Name of [Octicon](https://primer.style/octicons/) to use." }, { "name": "tag", "type": "Symbol", "default": "N/A", "description": "One of `:a`, `:button`, or `:summary`." }, { "name": "type", "type": "Symbol", "default": "N/A", "description": "One of `:button`, `:reset`, or `:submit`." }, { "name": "aria-label", "type": "String", "default": "N/A", "description": "String that can be read by assistive technology. A label should be short and concise. See the accessibility section for more information." }, { "name": "aria-description", "type": "String", "default": "N/A", "description": "String that can be read by assistive technology. A description can be longer as it is intended to provide more context and information. See the accessibility section for more information." }, { "name": "tooltip_direction", "type": "Symbol", "default": "`:s`", "description": "One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`." }, { "name": "box", "type": "Boolean", "default": "`false`", "description": "Whether the button is in a [BorderBox](/components/beta/borderbox). If `true`, the button will have the `Box-btn-octicon` class." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "AutoComplete", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/default/", "parameters": [ { "name": "label_text", "type": "String", "default": "N/A", "description": "The label of the input." }, { "name": "src", "type": "String", "default": "N/A", "description": "The route to query." }, { "name": "input_id", "type": "String", "default": "N/A", "description": "Id of the input element." }, { "name": "input_name", "type": "String", "default": "`nil`", "description": "Optional name of the input element, defaults to `input_id` when not set." }, { "name": "list_id", "type": "String", "default": "N/A", "description": "Id of the list element." }, { "name": "visually_hide_label", "type": "Boolean", "default": "`false`", "description": "Controls if the label is visible. If `true`, screen reader only text will be added." }, { "name": "show_clear_button", "type": "Boolean", "default": "`false`", "description": "Adds optional clear button." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" }, { "name": "size", "type": "Hash", "default": "`:medium`", "description": "Input size can be small, medium (default), or large" }, { "name": "full_width", "type": "Boolean", "default": "`false`", "description": "Input can be full-width or fit to content" }, { "name": "disabled", "type": "Boolean", "default": "`false`", "description": "Disabled input" }, { "name": "invalid", "type": "Boolean", "default": "`false`", "description": "Invalid input" }, { "name": "placeholder", "type": "String", "default": "`nil`", "description": "The placeholder text displayed within the input" }, { "name": "inset", "type": "Boolean", "default": "`false`", "description": "subtle input background color" }, { "name": "monospace", "type": "Boolean", "default": "`false`", "description": "monospace input font family" } ] }, { "component": "AutoComplete::Item", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete/item.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/item/default/", "parameters": [ { "name": "value", "type": "String", "default": "N/A", "description": "Value of the item." }, { "name": "selected", "type": "Boolean", "default": "`false`", "description": "Whether the item is selected." }, { "name": "disabled", "type": "Boolean", "default": "`false`", "description": "Whether the item is disabled." }, { "name": "description_variant", "type": "Hash", "default": "`:block`", "description": "Changes the description style. Allowed values are :inline, :block" }, { "name": "description", "type": "String", "default": "N/A", "description": "Display description text below label" }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Avatar", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/avatar.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/avatar/default/", "parameters": [ { "name": "src", "type": "String", "default": "N/A", "description": "The source url of the avatar image." }, { "name": "alt", "type": "String", "default": "N/A", "description": "Passed through to alt on img tag." }, { "name": "size", "type": "Integer", "default": "`20`", "description": "One of `16`, `20`, `24`, `32`, `40`, `48`, or `80`." }, { "name": "shape", "type": "Symbol", "default": "`:circle`", "description": "Shape of the avatar. One of `:circle` or `:square`." }, { "name": "href", "type": "String", "default": "`nil`", "description": "The URL to link to. If used, component will be wrapped by an `` tag." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "AvatarStack", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/avatar_stack.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/avatar_stack/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:div`", "description": "One of `:div` or `:span`." }, { "name": "align", "type": "Symbol", "default": "`:left`", "description": "One of `:left` or `:right`." }, { "name": "tooltipped", "type": "Boolean", "default": "`false`", "description": "Whether to add a tooltip to the stack or not." }, { "name": "body_arguments", "type": "Hash", "default": "`{}`", "description": "Parameters to add to the Body. If `tooltipped` is set, has the same arguments as [Tooltip](/components/tooltip). The default tag is `:div` but can be changed using `tag:` to one of `:div` or `:span`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "BaseButton", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/base_button.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/base_button/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:button`", "description": "One of `:a`, `:button`, or `:summary`." }, { "name": "type", "type": "Symbol", "default": "`:button`", "description": "One of `:button`, `:reset`, or `:submit`." }, { "name": "block", "type": "Boolean", "default": "`false`", "description": "Whether button is full-width with `display: block`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Banner", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/banner.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/banner/default/", "parameters": [ { "name": "full", "type": "Boolean", "default": "`false`", "description": "Whether the component should take up the full width of the screen." }, { "name": "full_when_narrow", "type": "Boolean", "default": "`false`", "description": "Whether the component should take up the full width of the screen when rendered inside smaller viewports." }, { "name": "dismissible", "type": "Boolean", "default": "`false`", "description": "Whether the component can be dismissed with an \"x\" button." }, { "name": "description", "type": "String", "default": "`nil`", "description": "Description text rendered underneath the message." }, { "name": "icon", "type": "Symbol", "default": "`nil`", "description": "The name of an [Octicon](https://primer.style/octicons/) icon to use. If no icon is provided, a default one will be chosen based on the scheme." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:danger`, `:default`, `:success`, or `:warning`." }, { "name": "reappear", "type": "Boolean", "default": "`false`", "description": "Whether or not the flash banner should reappear after being dismissed. Only for use in test and preview environments." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Blankslate", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/blankslate.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/blankslate/default/", "parameters": [ { "name": "narrow", "type": "Boolean", "default": "`false`", "description": "Adds a maximum width of `485px` to the Blankslate." }, { "name": "spacious", "type": "Boolean", "default": "`false`", "description": "Increases the padding from `32px` to `80px 40px`." }, { "name": "border", "type": "Boolean", "default": "`false`", "description": "Adds a border around the Blankslate." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "BorderBox", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/border_box.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/border_box/default/", "parameters": [ { "name": "padding", "type": "Symbol", "default": "`:default`", "description": "One of `:condensed`, `:default`, or `:spacious`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "BorderBox::Header", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/border_box/header.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/border_box/header/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Box", "status": "stable", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/box.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/box/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Breadcrumbs", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/breadcrumbs.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/breadcrumbs/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Button", "status": "deprecated", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/button_component.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/button/default/", "parameters": [ { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:danger`, `:default`, `:invisible`, `:link`, `:outline`, or `:primary`." }, { "name": "variant", "type": "Symbol", "default": "`nil`", "description": "DEPRECATED. One of `:medium` or `:small`." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:medium` or `:small`." }, { "name": "tag", "type": "Symbol", "default": "`:button`", "description": "One of `:a`, `:button`, or `:summary`." }, { "name": "type", "type": "Symbol", "default": "`:button`", "description": "One of `:button`, `:reset`, or `:submit`." }, { "name": "group_item", "type": "Boolean", "default": "`false`", "description": "Whether button is part of a ButtonGroup." }, { "name": "block", "type": "Boolean", "default": "`false`", "description": "Whether button is full-width with `display: block`." }, { "name": "dropdown", "type": "Boolean", "default": "`false`", "description": "Whether or not to render a dropdown caret." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ButtonGroup", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/button_group.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button_group/default/", "parameters": [ { "name": "variant", "type": "Symbol", "default": "`nil`", "description": "DEPRECATED. One of `:medium` or `:small`." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:medium` or `:small`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ButtonMarketing", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/button_marketing.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/button_marketing/default/", "parameters": [ { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:default`, `:outline`, `:primary`, or `:transparent`." }, { "name": "variant", "type": "Symbol", "default": "`:default`", "description": "One of `:default` or `:large`." }, { "name": "tag", "type": "Symbol", "default": "`:button`", "description": "One of `:a` or `:button`." }, { "name": "type", "type": "Symbol", "default": "`:button`", "description": "One of `:button` or `:submit`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ClipboardCopy", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/clipboard_copy.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/clipboard_copy/default/", "parameters": [ { "name": "aria-label", "type": "String", "default": "N/A", "description": "String that will be read to screenreaders when the component is focused" }, { "name": "value", "type": "String", "default": "`nil`", "description": "Text to copy into the users clipboard when they click the component." }, { "name": "for", "type": "String", "default": "N/A", "description": "Element id from where to get the copied value." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "CloseButton", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/close_button.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/close_button/default/", "parameters": [ { "name": "type", "type": "Symbol", "default": "`:button`", "description": "One of `:button` or `:submit`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Counter", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/counter.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/counter/default/", "parameters": [ { "name": "count", "type": "Integer, Float::INFINITY, nil", "default": "`0`", "description": "The number to be displayed (e.x. # of issues, pull requests)" }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "Color scheme. One of `:default`, `:primary`, or `:secondary`." }, { "name": "limit", "type": "Integer, nil", "default": "`5_000`", "description": "Maximum value to display. Pass `nil` for no limit. (e.x. if `count` == 6,000 and `limit` == 5000, counter will display \"5,000+\")" }, { "name": "hide_if_zero", "type": "Boolean", "default": "`false`", "description": "If true, a `hidden` attribute is added to the counter if `count` is zero." }, { "name": "text", "type": "String", "default": "`\"\"`", "description": "Text to display instead of count." }, { "name": "round", "type": "Boolean", "default": "`false`", "description": "Whether to apply our standard rounding logic to value." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Details", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/details.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/details/default/", "parameters": [ { "name": "overlay", "type": "Symbol", "default": "`:none`", "description": "Dictates the type of overlay to render with. One of `:dark`, `:default`, or `:none`." }, { "name": "reset", "type": "Boolean", "default": "`false`", "description": "Defaults to false. If set to true, it will remove the default caret and remove style from the summary element" }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Dialog", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dialog.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/dialog/default/", "parameters": [ { "name": "id", "type": "String", "default": "`self.class.generate_id`", "description": "The id of the dialog." }, { "name": "title", "type": "String", "default": "N/A", "description": "Describes the content of the dialog." }, { "name": "subtitle", "type": "String", "default": "`nil`", "description": "Provides additional context for the dialog, also setting the `aria-describedby` attribute." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "The size of the dialog. One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`." }, { "name": "position", "type": "Symbol", "default": "`:center`", "description": "The position of the dialog. One of `:center`, `:left`, or `:right`." }, { "name": "position_narrow", "type": "Symbol", "default": "`:inherit`", "description": "The position of the dialog when narrow. One of `:bottom`, `:fullscreen`, `:inherit`, `:left`, or `:right`." }, { "name": "visually_hide_title", "type": "Boolean", "default": "`false`", "description": "If true will hide the heading title, while still making it available to Screen Readers." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Dropdown", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/dropdown.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/dropdown/default/", "parameters": [ { "name": "overlay", "type": "Symbol", "default": "`:default`", "description": "One of `:dark`, `:default`, or `:none`." }, { "name": "with_caret", "type": "Boolean", "default": "`false`", "description": "Whether or not a caret should be rendered in the button." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Flash", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/flash.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/flash/default/", "parameters": [ { "name": "full", "type": "Boolean", "default": "`false`", "description": "Whether the component should take up the full width of the screen." }, { "name": "spacious", "type": "Boolean", "default": "`false`", "description": "Whether to add margin to the bottom of the component." }, { "name": "dismissible", "type": "Boolean", "default": "`false`", "description": "Whether the component can be dismissed with an X button." }, { "name": "icon", "type": "Symbol", "default": "`nil`", "description": "Name of Octicon icon to use." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:danger`, `:default`, `:success`, or `:warning`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Heading", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/heading.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/heading/default/", "parameters": [ { "name": "tag", "type": "String", "default": "N/A", "description": "One of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, or `:h6`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "HiddenTextExpander", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/hidden_text_expander.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/hidden_text_expander/default/", "parameters": [ { "name": "inline", "type": "Boolean", "default": "`false`", "description": "Whether or not the expander is inline." }, { "name": "button_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the button element." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Label", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/label.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/label/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:span`", "description": "One of `:a`, `:div`, `:span`, or `:summary`." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:accent`, `:attention`, `:danger`, `:default`, `:done`, `:info`, `:orange`, `:primary`, `:purple`, `:secondary`, `:severe`, `:sponsors`, `:success`, or `:warning`." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:large` or `:medium`." }, { "name": "inline", "type": "Boolean", "default": "`false`", "description": "Whether or not to render this label inline." }, { "name": "variant", "type": "Symbol", "default": "`:none`", "description": "One of `:inline`, `:large`, or `:none`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Layout", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/layout_component.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/layout/default/", "parameters": [ { "name": "responsive", "type": "Boolean", "default": "`false`", "description": "Whether to collapse layout to a single column at smaller widths." }, { "name": "side", "type": "Symbol", "default": "`:right`", "description": "Which side to display the sidebar on. One of `:left` or `:right`." }, { "name": "sidebar_col", "type": "Integer", "default": "`3`", "description": "Sidebar column width." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Link", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/link.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/link/default/", "parameters": [ { "name": "tag", "type": "String", "default": "`:a`", "description": "One of `:a` or `:span`." }, { "name": "href", "type": "String", "default": "`nil`", "description": "URL to be used for the Link. Required if tag is `:a`. If the requirements are not met an error will be raised in non production environments. In production, an empty link element will be rendered." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "One of `:default`, `:primary`, or `:secondary`." }, { "name": "muted", "type": "Boolean", "default": "`false`", "description": "Uses light gray for Link color, and blue on hover." }, { "name": "underline", "type": "Boolean", "default": "`true`", "description": "Whether or not to underline the link." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Markdown", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/markdown.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/markdown/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:div`", "description": "One of `:article`, `:div`, or `:td`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Menu", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/menu.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/menu/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Navigation::Tab", "status": "deprecated", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/navigation/tab_component.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/navigation/tab/default/", "parameters": [ { "name": "list", "type": "Boolean", "default": "`false`", "description": "Whether the Tab is an item in a `
    ` list." }, { "name": "selected", "type": "Boolean", "default": "`false`", "description": "Whether the Tab is selected or not." }, { "name": "with_panel", "type": "Boolean", "default": "`false`", "description": "Whether the Tab has an associated panel." }, { "name": "panel_id", "type": "String", "default": "`\"\"`", "description": "Only applies if `with_panel` is `true`. Unique id of panel." }, { "name": "icon_classes", "type": "Boolean", "default": "`\"\"`", "description": "Classes that must always be applied to icons." }, { "name": "wrapper_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) to be used in the `
  • ` wrapper when the tab is an item in a list." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Navigation::Tab", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/navigation/tab.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/navigation/tab/default/", "parameters": [ { "name": "list", "type": "Boolean", "default": "`false`", "description": "Whether the Tab is an item in a `
      ` list." }, { "name": "selected", "type": "Boolean", "default": "`false`", "description": "Whether the Tab is selected or not." }, { "name": "with_panel", "type": "Boolean", "default": "`false`", "description": "Whether the Tab has an associated panel." }, { "name": "panel_id", "type": "String", "default": "`\"\"`", "description": "Only applies if `with_panel` is `true`. Unique id of panel." }, { "name": "icon_classes", "type": "Boolean", "default": "`\"\"`", "description": "Classes that must always be applied to icons." }, { "name": "wrapper_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) to be used in the `
    • ` wrapper when the tab is an item in a list." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Octicon", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/octicon.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/octicon/default/", "parameters": [ { "name": "icon_name", "type": "Symbol, String", "default": "`nil`", "description": "Name of [Octicon](https://primer.style/octicons/) to use." }, { "name": "icon", "type": "Symbol, String", "default": "`nil`", "description": "Name of [Octicon](https://primer.style/octicons/) to use." }, { "name": "size", "type": "Symbol", "default": "`:small`", "description": "One of `:xsmall` (`12`), `:small` (`16`), or `:medium` (`24`)." }, { "name": "use_symbol", "type": "Boolean", "default": "`false`", "description": "EXPERIMENTAL (May change or be removed) - Set to true when using with [OcticonSymbols](/components/alpha/octiconsymbols)." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Popover", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/popover.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/popover/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ProgressBar", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/progress_bar.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/progress_bar/default/", "parameters": [ { "name": "size", "type": "Symbol", "default": "`:default`", "description": "One of `:default`, `:large`, or `:small`. Increases height." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "State", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/state.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/state/default/", "parameters": [ { "name": "title", "type": "String", "default": "N/A", "description": "`title` HTML attribute." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "Background color. One of `:closed`, `:default`, `:green`, `:merged`, `:open`, `:purple`, or `:red`." }, { "name": "tag", "type": "Symbol", "default": "`:span`", "description": "HTML tag for element. One of `:div` or `:span`." }, { "name": "size", "type": "Symbol", "default": "`:default`", "description": "One of `:default` or `:small`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Spinner", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/spinner.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/spinner/default/", "parameters": [ { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `[:large, 64]`, `[:medium, 32]`, or `[:small, 16]`." }, { "name": "style", "type": "String", "default": "`box-sizing: content-box; color: var(--color-icon-primary);`", "description": "Custom element styles." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Subhead", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/subhead.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/subhead/default/", "parameters": [ { "name": "spacious", "type": "Boolean", "default": "`false`", "description": "Whether to add spacing to the Subhead." }, { "name": "hide_border", "type": "Boolean", "default": "`false`", "description": "Whether to hide the border under the heading." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "TabContainer", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tab_container.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tab_container/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Text", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/text.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/text/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:span`", "description": "" }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "TimelineItem", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/timeline_item.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/timeline_item/default/", "parameters": [ { "name": "condensed", "type": "Boolean", "default": "`false`", "description": "Reduce the vertical padding and remove the background from the badge item. Most commonly used in commits." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Tooltip", "status": "deprecated", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/tooltip.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/tooltip/default/", "parameters": [ { "name": "label", "type": "String", "default": "N/A", "description": "the text to appear in the tooltip" }, { "name": "direction", "type": "String", "default": "`:n`", "description": "Direction of the tooltip. One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`." }, { "name": "align", "type": "String", "default": "`:default`", "description": "Align tooltips to the left or right of an element, combined with a `direction` to specify north or south. One of `:default`, `:left_1`, `:left_2`, `:right_1`, or `:right_2`." }, { "name": "multiline", "type": "Boolean", "default": "`false`", "description": "Use this when you have long content" }, { "name": "no_delay", "type": "Boolean", "default": "`false`", "description": "By default the tooltips have a slight delay before appearing. Set true to override this" }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Truncate", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/truncate.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/truncate/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:div`", "description": "One of `:div`, `:p`, `:span`, or `:strong`." }, { "name": "inline", "type": "Boolean", "default": "`false`", "description": "Whether the element is inline (or inline-block)." }, { "name": "expandable", "type": "Boolean", "default": "`false`", "description": "Whether the entire string should be revealed on hover. Can only be used in conjunction with `inline`." }, { "name": "max_width", "type": "Integer", "default": "`nil`", "description": "Sets the max-width of the text." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Truncate", "status": "beta", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/truncate.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/truncate/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "UnderlineNav", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/underline_nav.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/underline_nav/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:nav`", "description": "One of `:div` or `:nav`." }, { "name": "label", "type": "String", "default": "N/A", "description": "Sets an `aria-label` that helps assistive technology users understand the purpose of the links, and distinguish it from similar elements." }, { "name": "align", "type": "Symbol", "default": "`:left`", "description": "One of `:left` or `:right`. - Defaults to left" }, { "name": "body_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the body wrapper." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "UnderlinePanels", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/underline_panels.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/underline_panels/default/", "parameters": [ { "name": "label", "type": "String", "default": "N/A", "description": "Sets an `aria-label` that helps assistive technology users understand the purpose of the tabs." }, { "name": "align", "type": "Symbol", "default": "`:left`", "description": "One of `:left` or `:right`. - Defaults to left" }, { "name": "body_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the body wrapper." }, { "name": "wrapper_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the `TabContainer` wrapper." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "TabNav", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tab_nav.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tab_nav/default/", "parameters": [ { "name": "tag", "type": "Symbol", "default": "`:nav`", "description": "One of `:div` or `:nav`." }, { "name": "label", "type": "String", "default": "N/A", "description": "Sets an `aria-label` that helps assistive technology users understand the purpose of the links, and distinguish it from similar elements." }, { "name": "body_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the body wrapper." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "TabPanels", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tab_panels.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tab_panels/default/", "parameters": [ { "name": "label", "type": "String", "default": "N/A", "description": "Sets an `aria-label` that helps assistive technology users understand the purpose of the tabs." }, { "name": "align", "type": "Symbol", "default": "N/A", "description": "One of `:left` or `:right`. - Defaults to left" }, { "name": "body_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the body wrapper." }, { "name": "wrapper_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) for the `TabContainer` wrapper." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Tooltip", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tooltip.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/tooltip/default/", "parameters": [ { "name": "for_id", "type": "String", "default": "N/A", "description": "The ID of the element that the tooltip should be attached to." }, { "name": "type", "type": "Symbol", "default": "N/A", "description": "One of `:description` or `:label`." }, { "name": "direction", "type": "Symbol", "default": "`:s`", "description": "One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`." }, { "name": "text", "type": "String", "default": "N/A", "description": "The text content of the tooltip. This should be brief and no longer than a sentence." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ToggleSwitch", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/toggle_switch.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/toggle_switch/default/", "parameters": [ { "name": "src", "type": "String", "default": "`nil`", "description": "The URL to POST to when the toggle switch is toggled. If `nil`, the toggle switch will not make any requests." }, { "name": "csrf_token", "type": "String", "default": "`nil`", "description": "A CSRF token that will be sent to the server as \"authenticity_token\" when the toggle switch is toggled. Unused if `src` is `nil`." }, { "name": "checked", "type": "Boolean", "default": "`false`", "description": "Whether the toggle switch is on or off." }, { "name": "enabled", "type": "Boolean", "default": "`true`", "description": "Whether or not the toggle switch responds to user input." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "What size toggle switch to render. One of `:end` or `:start`." }, { "name": "status_label_position", "type": "Symbol", "default": "`:start`", "description": "Which side of the toggle switch to render the status label. One of `:medium` or `:small`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Overlay", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/overlay.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/overlay/default/", "parameters": [ { "name": "id", "type": "String", "default": "`self.class.generate_id`", "description": "The id of the Overlay." }, { "name": "title", "type": "String", "default": "N/A", "description": "Describes the content of the Overlay." }, { "name": "subtitle", "type": "String", "default": "`nil`", "description": "Provides dditional context for the Overlay, also setting the `aria-describedby` attribute." }, { "name": "popover", "type": "Symbol", "default": "`:auto`", "description": "The popover behaviour. One of `:auto` or `:manual`." }, { "name": "popover", "type": "Symbol", "default": "`:auto`", "description": "The popover behaviour. One of `:auto` or `:manual`." }, { "name": "size", "type": "Symbol", "default": "`:auto`", "description": "The size of the Overlay. One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`." }, { "name": "padding", "type": "Symbol", "default": "`:normal`", "description": "The padding given to the Overlay body. One of `:condensed`, `:none`, or `:normal`." }, { "name": "anchor", "type": "String", "default": "`nil`", "description": "An ID of the element to anchor onto. Defaults to the `show_button`." }, { "name": "anchor_align", "type": "Symbol", "default": "`:start`", "description": "The anchor alignment of the Overlay. One of `:center`, `:end`, or `:start`." }, { "name": "anchor_side", "type": "Symbol", "default": "`:outside_bottom`", "description": "The side to anchor the Overlay to. One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`." }, { "name": "anchor_offset", "type": "Symbol", "default": "`:normal`", "description": "The anchor offset to give the Overlay. One of `:normal` or `:spacious`." }, { "name": "allow_out_of_bounds", "type": "Boolean", "default": "`false`", "description": "Allow the Overlay to overflow its container." }, { "name": "visually_hide_title", "type": "Boolean", "default": "`false`", "description": "If true will hide the heading title, while still making it available to Screen Readers." }, { "name": "role", "type": "String", "default": "N/A", "description": "The ARIA role. One of `:dialog` or `:menu`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "NavList", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/default/", "parameters": [ { "name": "selected_item_id", "type": "Symbol", "default": "`nil`", "description": "The ID of the currently selected item. The default is `nil`, meaning no item is selected." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "NavList::Item", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/item.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/item/default/", "parameters": [ { "name": "selected_item_id", "type": "Symbol", "default": "`nil`", "description": "The ID of the currently selected list item. Used internally." }, { "name": "selected_by_ids", "type": "Array", "default": "`[]`", "description": "The list of IDs that select this item. In other words, if the `selected_item_id` attribute on the parent `NavList` is set to one of these IDs, the item will appear selected." }, { "name": "expanded", "type": "Boolean", "default": "`false`", "description": "Whether this item shows (expands) or hides (collapses) its list of sub items." }, { "name": "sub_item", "type": "Boolean", "default": "`false`", "description": "Whether or not this item is nested under a parent item. Used internally." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "NavList::Group", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/group.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/group/default/", "parameters": [ { "name": "selected_item_id", "type": "Symbol", "default": "`nil`", "description": "The ID of the currently selected item. Used internally." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/default/", "parameters": [ { "name": "role", "type": "Boolean", "default": "`:list`", "description": "ARIA role describing the function of the list. listbox and menu are a common values." }, { "name": "item_classes", "type": "String", "default": "`nil`", "description": "Additional CSS classes to attach to items." }, { "name": "scheme", "type": "Symbol", "default": "`:full`", "description": "One of `:full` or `:inset`.. `inset` children are offset (vertically and horizontally) from list edges. `full` (default) children are flush (vertically and horizontally) with list edges." }, { "name": "show_dividers", "type": "Boolean", "default": "`false`", "description": "Display a divider above each item in the list when it does not follow a header or divider." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList::Divider", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/divider.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/divider/default/", "parameters": [ { "name": "scheme", "type": "Symbol", "default": "`:subtle`", "description": "Display a background color if scheme is `filled`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList::Heading", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/heading.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/heading/default/", "parameters": [ { "name": "list_id", "type": "String", "default": "N/A", "description": "The unique identifier of the sub list the heading belongs to. Used internally." }, { "name": "title", "type": "String", "default": "N/A", "description": "Sub list title." }, { "name": "heading_level", "type": "Integer", "default": "`3`", "description": "Heading level. Level 2 results in an `

      ` tag, level 3 an `

      ` tag, etc." }, { "name": "subtitle", "type": "String", "default": "`nil`", "description": "Optional sub list description." }, { "name": "scheme", "type": "Symbol", "default": "`:subtle`", "description": "Display a background color if scheme is `filled`." }, { "name": "tag", "type": "Integer", "default": "N/A", "description": "Semantic tag for the heading." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList::Item", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/item.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/item/default/", "parameters": [ { "name": "list", "type": "Primer::Alpha::ActionList", "default": "N/A", "description": "The list that contains this item. Used internally." }, { "name": "parent", "type": "Primer::Alpha::ActionList::Item", "default": "`nil`", "description": "This item's parent item. `nil` if this item is at the root. Used internally." }, { "name": "label", "type": "String", "default": "N/A", "description": "Item label." }, { "name": "label_classes", "type": "String", "default": "`nil`", "description": "CSS classes that will be added to the label." }, { "name": "label_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) used to construct the label." }, { "name": "content_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) used to construct the item's anchor or button tag." }, { "name": "truncate_label", "type": "Boolean", "default": "`false`", "description": "Truncate label with ellipsis." }, { "name": "href", "type": "String", "default": "`nil`", "description": "Link URL." }, { "name": "role", "type": "String", "default": "`nil`", "description": "ARIA role describing the function of the item." }, { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "Controls block sizing of the item." }, { "name": "scheme", "type": "Symbol", "default": "`:default`", "description": "Controls color/style based on behavior." }, { "name": "disabled", "type": "Boolean", "default": "`false`", "description": "Disabled items are not clickable and visually dim." }, { "name": "description_scheme", "type": "Symbol", "default": "`:block`", "description": "Display description inline with label, or block on the next line." }, { "name": "active", "type": "Boolean", "default": "`false`", "description": "Sets an active state on navigational items." }, { "name": "on_click", "type": "String", "default": "`nil`", "description": "JavaScript to execute when the item is clicked." }, { "name": "id", "type": "String", "default": "`self.class.generate_id`", "description": "Used internally." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "TextField", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/text_field.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/text_field/default/", "parameters": [ { "name": "size", "type": "Symbol", "default": "N/A", "description": "The size of the field. One of `:large`, `:medium`, or `:small`." }, { "name": "full_width", "type": "Boolean", "default": "N/A", "description": "When set to `true`, the field will take up all the horizontal space allowed by its container." }, { "name": "name", "type": "String", "default": "N/A", "description": "Value for the HTML name attribute." }, { "name": "id", "type": "String", "default": "N/A", "description": "Value for the HTML id attribute." }, { "name": "class", "type": "String", "default": "N/A", "description": "CSS classes to include in the input's HTML `class` attribute. Exists for compatibility with Rails form builders." }, { "name": "classes", "type": "Array", "default": "N/A", "description": "CSS classes to include in the input's HTML `class` attribute. Combined with the `:class` argument. The list may contain strings, hashes, or `nil` values, and is automatically cleaned up by Primer's [`class_name` helper](https://github.com/primer/view_components/blob/c9cb95c98fee3e2e27f4a10683f555e22285e7f1/app/lib/primer/class_name_helper.rb) (`nils`, falsy entries, and blank strings are ignored)." }, { "name": "caption", "type": "String", "default": "N/A", "description": "A string describing the field and what sorts of input it expects. Displayed below the input." }, { "name": "label", "type": "String", "default": "N/A", "description": "Label text displayed above the input." }, { "name": "visually_hide_label", "type": "Boolean", "default": "N/A", "description": "When set to `true`, hides the label. Although the label will be hidden visually, it will still be visible to screen readers." }, { "name": "disabled", "type": "Boolean", "default": "N/A", "description": "When set to `true`, the input will not accept keyboard or mouse input." }, { "name": "hidden", "type": "Boolean", "default": "N/A", "description": "When set to `true`, visually hides the field." }, { "name": "invalid", "type": "Boolean", "default": "N/A", "description": "If set to `true`, the input will be rendered with a red border. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect." }, { "name": "validation_message", "type": "String", "default": "N/A", "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object." }, { "name": "label_arguments", "type": "Hash", "default": "N/A", "description": "Attributes that will be passed to Rails' `builder.label` method. These can be HTML attributes or any of the other label options Rails supports. They will appear as HTML attributes on the `