Skip to content

ActionList: Add more variant options to ActionList#7924

Open
TylerJDev wants to merge 3 commits into
mainfrom
tylerjdev/add-action-list-variant-inset-options
Open

ActionList: Add more variant options to ActionList#7924
TylerJDev wants to merge 3 commits into
mainfrom
tylerjdev/add-action-list-variant-inset-options

Conversation

@TylerJDev

@TylerJDev TylerJDev commented Jun 5, 2026

Copy link
Copy Markdown
Member

Adds three new variant options to ActionList for more control over how items are offset from the list's edges, and exposes the variant prop on NavList that forwards to ActionList.

  • start - offsets only the start edge (margin-inline-start)
  • end - offsets only the end edge (margin-inline-end)
  • vertical-inset - offsets items vertically but not horizontally

Changelog

New

  • variant prop accepts start, end, and vertical-inset.
  • NavList now accepts a variant prop that is forwarded to its underlying ActionList.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge
  • (GitHub staff only) Integration tests pass at github/github-ui

@changeset-bot

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 71b5140

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@TylerJDev TylerJDev added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jun 5, 2026
@github-actions github-actions Bot temporarily deployed to storybook-preview-7924 June 5, 2026 15:06 Inactive
@primer

primer Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Formatting issues have been automatically fixed and committed to this PR.

@github-actions github-actions Bot temporarily deployed to storybook-preview-7924 June 5, 2026 15:28 Inactive
@TylerJDev TylerJDev requested a review from adierkens June 5, 2026 16:27
@TylerJDev TylerJDev marked this pull request as ready for review June 5, 2026 16:27
@TylerJDev TylerJDev requested a review from a team as a code owner June 5, 2026 16:27
Copilot AI review requested due to automatic review settings June 5, 2026 16:27
@primer-integration

primer-integration Bot commented Jun 5, 2026

Copy link
Copy Markdown

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/22540.

Will report CI results once ready.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional layout variants to ActionList and exposes the same variant control on NavList by forwarding it to the underlying ActionList, enabling more granular inset behavior.

Changes:

  • Expanded ActionList’s variant union to include start, end, and vertical-inset.
  • Implemented corresponding CSS behaviors for the new variants and updated Storybook controls.
  • Added NavList variant prop that forwards to ActionList, plus docs/changeset updates.
Show a summary per file
File Description
packages/react/src/NavList/NavList.tsx Adds variant prop to NavList and forwards it to ActionList.
packages/react/src/ActionList/shared.ts Extends ActionListProps['variant'] type to include new options.
packages/react/src/ActionList/Heading.module.css Updates heading offset rules to account for new list variants.
packages/react/src/ActionList/ActionList.stories.tsx Updates Storybook variant control options to include new variants.
packages/react/src/ActionList/ActionList.module.css Adds styling rules for start/end and vertical inset behavior.
packages/react/src/ActionList/ActionList.docs.json Updates the documented variant type (but description needs updating too).
.changeset/actionlist-variant-start-end-vertical-inset.md Adds a minor changeset entry for the new variants and NavList forwarding.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 5

Comment on lines 138 to +141
/**
* `inset` children are offset (vertically and horizontally) from `List`’s edges, `full` children are flush (vertically and horizontally) with `List` edges
*/
variant?: 'inset' | 'horizontal-inset' | 'full'
variant?: 'inset' | 'horizontal-inset' | 'vertical-inset' | 'full' | 'start' | 'end'
Comment on lines 16 to 21
{
"name": "variant",
"type": "'inset' | 'horizontal-inset' | 'full'",
"type": "'inset' | 'horizontal-inset' | 'vertical-inset' | 'full' | 'start' | 'end'",
"defaultValue": "'inset'",
"description": "`inset` children are offset (vertically and/or horizontally) from list edges. `full` children are flush (vertically and horizontally) with list edges"
},
Comment on lines 27 to +43
export type NavListProps = {
children: React.ReactNode
/**
* Style variations for the underlying `ActionList`. See `ActionList`'s `variant` prop for details.
*/
variant?: ActionListProps['variant']
} & React.ComponentProps<'nav'>

const Root = React.forwardRef<HTMLElement, NavListProps>(({children, ...props}, ref) => {
const Root = React.forwardRef<HTMLElement, NavListProps>(({children, variant, ...props}, ref) => {
return (
<nav {...props} ref={ref}>
<ActionListContainerContext.Provider
value={{
container: 'NavList',
}}
>
<ActionList>{children}</ActionList>
<ActionList variant={variant}>{children}</ActionList>
Comment on lines 138 to 142
/**
* `inset` children are offset (vertically and horizontally) from `List`’s edges, `full` children are flush (vertically and horizontally) with `List` edges
*/
variant?: 'inset' | 'horizontal-inset' | 'full'
variant?: 'inset' | 'horizontal-inset' | 'vertical-inset' | 'full' | 'start' | 'end'
/**
Comment on lines +5 to +7
ActionList: Add `start`, `end`, and `vertical-inset` options to the `variant` prop. `start` and `end` offset only the start or end edge (`margin-inline-start` / `margin-inline-end`) respectively, and `vertical-inset` offsets items vertically but not horizontally from the list's edges.

NavList: Add a `variant` prop that is forwarded to the underlying `ActionList`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Canary Release Apply this label when you want CI to create a canary release of the current PR integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants