[ { "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": "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": "Symbol", "default": "`:h3`", "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": "content_arguments", "type": "Hash", "default": "`{}`", "description": "[System arguments](/system-arguments) used to construct the item's anchor or span 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": "`:listitem`", "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": "`SecureRandom.hex`", "description": "Used internally." }, { "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": "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": "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": "`\"dialog-#{(36**3 + rand(36**4)).to_s(36)}\"`", "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 `: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": "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": "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": "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": "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": "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::Section", "status": "alpha", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/section.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/nav_list/section/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": "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": "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": "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": "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": "A list of CSS classes to add to the input. Exists for compatibility with Rails form builders." }, { "name": "classes", "type": "String", "default": "N/A", "description": "A list of CSS classes to add to the input. Combined with the `:class` argument." }, { "name": "caption", "type": "String", "default": "N/A", "description": "Caption text to render 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": "Whether or not to visually hide the label. If `true` the label will be hidden visually but still available to screen readers." }, { "name": "size", "type": "Symbol", "default": "N/A", "description": "The size of the field. One of `:large`, `:medium`, or `:small`." }, { "name": "show_clear_button", "type": "Boolean", "default": "N/A", "description": "Whether or not to include a clear button inside the input that clears the input's contents when clicked." }, { "name": "clear_button_id", "type": "String", "default": "N/A", "description": "The HTML id attribute of the clear button." }, { "name": "full_width", "type": "Boolean", "default": "N/A", "description": "Controls whether or not the input takes the full width of its container." }, { "name": "disabled", "type": "Boolean", "default": "N/A", "description": "Whether or not the input should accept keyboard and mouse input." }, { "name": "invalid", "type": "Boolean", "default": "N/A", "description": "If `true`, renders the input in a visually invalid state." }, { "name": "placeholder", "type": "String", "default": "N/A", "description": "Placeholder text." }, { "name": "inset", "type": "Boolean", "default": "N/A", "description": "If `true`, renders the input in a visually inset state." }, { "name": "monospace", "type": "Boolean", "default": "N/A", "description": "If `true`, uses a monospace font for the input field." }, { "name": "leading_visual", "type": "Hash", "default": "N/A", "description": "Renders a leading visual icon before the text field's cursor. The hash will be passed to Primer's [Octicon component](https://primer.style/view-components/components/octicon)." }, { "name": "validation_message", "type": "String", "default": "N/A", "description": "A validation message to display beneath the input. Implicitly sets `invalid` to `true`." }, { "name": "label_arguments", "type": "Hash", "default": "N/A", "description": "System arugments passed to the Rails builder's `#label` method. These arguments will appear as HTML attributes on the `