[ { "component": "ActionBar", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionBar", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/default/", "parameters": [ { "name": "size", "type": "Symbol", "default": "`:medium`", "description": "One of `:large`, `:medium`, or `:small`." }, { "name": "overflow_menu", "type": "Boolean", "default": "`true`", "description": "Whether to render the overflow menu." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionBar::Divider", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionBarDivider", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/divider.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/divider/default/", "parameters": [ ] }, { "component": "ActionBar::Item", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionBarItem", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/item.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/item/default/", "parameters": [ { "name": "item_content", "type": "String", "default": "N/A", "description": "The content to render inside the item." }, { "name": "item_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList", "status": "alpha", "a11y_reviewed": true, "short_name": "ActionList", "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": "id", "type": "String", "default": "`self.class.generate_id`", "description": "HTML ID value." }, { "name": "role", "type": "Boolean", "default": "`nil`", "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": "select_variant", "type": "Symbol", "default": "`:none`", "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`." }, { "name": "aria_selection_variant", "type": "Symbol", "default": "`:checked`", "description": "Specifies which aria selection to use. <%= one_of(Primer::Alpha::ActionList::ARIA_SELECTION_VARIANT_OPTIONS) %?" }, { "name": "form_arguments", "type": "Hash", "default": "`{}`", "description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an [ActionMenu](/components/alpha/actionmenu) instead of using this feature directly." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList::Divider", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionListDivider", "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::FormWrapper", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionListFormWrapper", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/", "parameters": [ ] }, { "component": "ActionList::Heading", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionListHeading", "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": "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": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionList::Item", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionListItem", "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": "`nil`", "description": "Item label. If no label is provided, content is used." }, { "name": "item_id", "type": "String", "default": "`nil`", "description": "An ID that will be attached to the item's `
  • ` element as `data-item-id` for distinguishing between items, perhaps in JavaScript." }, { "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": "form_arguments", "type": "Hash", "default": "`{}`", "description": "Allows the item to submit a form on click. The URL passed in the `href:` option will be used as the form action. Pass the `method:` option to this hash to control what kind of request is made, One of `:delete`, `:get`, `:head`, `:patch`, `:post`, or `:put`. The `name:` option is required and specifies the desired name of the field that will be included in the params sent to the server on form submission. Specify the `value:` option to send a custom value to the server; otherwise the value of `name:` is sent." }, { "name": "truncate_label", "type": "Boolean | Symbol", "default": "`:none`", "description": "How the label should be truncated when the text does not fit inside the bounds of the list item. One of `false`, `:none`, `:show_tooltip`, `:truncate`, or `true`. Pass `false` or `:none` to wrap label text. Pass `true` or `:truncate` to truncate labels with ellipses. Pass `:show_tooltip` to show the entire label contents in a tooltip when the item is hovered." }, { "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. One of `:block` or `:inline`." }, { "name": "active", "type": "Boolean", "default": "`false`", "description": "If the parent list's `select_variant` is set to `:single` or `:multiple`, causes this item to render checked." }, { "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": "ActionMenu", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionMenu", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/default/", "parameters": [ { "name": "menu_id", "type": "String", "default": "`self.class.generate_id`", "description": "Id of the menu." }, { "name": "anchor_align", "type": "Symbol", "default": "`:start`", "description": "One of `:center`, `:end`, or `:start`.." }, { "name": "anchor_side", "type": "Symbol", "default": "`:outside_bottom`", "description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`.." }, { "name": "size", "type": "Symbol", "default": "`:auto`", "description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.." }, { "name": "src", "type": "String", "default": "`nil`", "description": "Used with an `include-fragment` element to load menu content from the given source URL." }, { "name": "preload", "type": "Boolean", "default": "`false`", "description": "When true, and src is present, loads the `include-fragment` on trigger hover." }, { "name": "dynamic_label", "type": "Boolean", "default": "`false`", "description": "Whether or not to display the text of the currently selected item in the show button." }, { "name": "dynamic_label_prefix", "type": "String", "default": "`nil`", "description": "If provided, the prefix is prepended to the dynamic label and displayed in the show button." }, { "name": "select_variant", "type": "Symbol", "default": "`:none`", "description": "One of `:multiple`, `:none`, or `:single`." }, { "name": "form_arguments", "type": "Hash", "default": "`{}`", "description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission." }, { "name": "overlay_arguments", "type": "Hash", "default": "`{}`", "description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)" }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)." } ] }, { "component": "ActionMenu::Group", "status": "alpha", "a11y_reviewed": true, "short_name": "ActionMenuGroup", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/group.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/group/default/", "parameters": [ { "name": "id", "type": "String", "default": "`self.class.generate_id`", "description": "HTML ID value." }, { "name": "role", "type": "Boolean", "default": "`nil`", "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": "select_variant", "type": "Symbol", "default": "`:none`", "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`." }, { "name": "aria_selection_variant", "type": "Symbol", "default": "`:checked`", "description": "Specifies which aria selection to use. <%= one_of(Primer::Alpha::ActionList::ARIA_SELECTION_VARIANT_OPTIONS) %?" }, { "name": "form_arguments", "type": "Hash", "default": "`{}`", "description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an [ActionMenu](/components/alpha/actionmenu) instead of using this feature directly." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ActionMenu::Heading", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionMenuHeading", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/heading.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/heading/default/", "parameters": [ ] }, { "component": "ActionMenu::List", "status": "alpha", "a11y_reviewed": false, "short_name": "ActionMenuList", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/list.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/list/default/", "parameters": [ { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "The arguments accepted by [ActionList](/components/alpha/actionlist)" } ] }, { "component": "ActionMenu::ListWrapper", "status": "alpha", "a11y_reviewed": true, "short_name": "ActionMenuListWrapper", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_menu/list_wrapper.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_menu/list_wrapper/default/", "parameters": [ { "name": "menu_id", "type": "String", "default": "N/A", "description": "ID of the parent menu." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "The arguments accepted by [ActionList](/components/alpha/actionlist)" } ] }, { "component": "AutoComplete", "status": "deprecated", "a11y_reviewed": false, "short_name": "AutoComplete", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/auto_complete.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/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": "with_icon", "type": "Boolean", "default": "`false`", "description": "Controls if a search icon is visible, defaults to `false`." }, { "name": "is_label_visible", "type": "Boolean", "default": "`true`", "description": "Controls if the label is visible. If `false`, screen reader only text will be added." }, { "name": "is_clearable", "type": "Boolean", "default": "`false`", "description": "Adds optional clear button." }, { "name": "is_label_inline", "type": "Boolean", "default": "`false`", "description": "Controls if the label is inline. On smaller screens, label will always become stacked." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "AutoComplete::Item", "status": "deprecated", "a11y_reviewed": false, "short_name": "AutoCompleteItem", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/auto_complete/item.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/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": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "Banner", "status": "alpha", "a11y_reviewed": false, "short_name": "Banner", "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": "tag", "type": "Symbol", "default": "`:div`", "description": "One of `:div` or `:section`." }, { "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": "dismiss_scheme", "type": "Symbol", "default": "`:none`", "description": "Whether the component can be dismissed with an \"x\" button. One of `:hide`, `:none`, or `:remove`." }, { "name": "dismiss_label", "type": "String", "default": "`Dismiss`", "description": "The aria-label text of the dismiss \"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": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "ButtonMarketing", "status": "alpha", "a11y_reviewed": false, "short_name": "ButtonMarketing", "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": "disabled", "type": "Boolean", "default": "`false`", "description": "Whether or not the button is disabled. If true, this option forces `tag:` to `:button`." }, { "name": "system_arguments", "type": "Hash", "default": "N/A", "description": "[System arguments](/system-arguments)" } ] }, { "component": "CheckBox", "status": "alpha", "a11y_reviewed": false, "short_name": "CheckBox", "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/check_box.rb", "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/check_box/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": "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 `