Skip to content

Rename button component props - #335

Merged
devmount merged 7 commits into
mainfrom
enhancements/171-restructure-button-component
Oct 5, 2026
Merged

devmount merged 7 commits into
mainfrom
enhancements/171-restructure-button-component

Conversation

@devmount

@devmount devmount commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

What changed?

Warning

This is a breaking change.

Renamed BaseButton props to remove the naming clash with the native HTML button type attribute and make naming more intuitive:

  • type (visual style) is renamed to variant
  • variant (filled/outline) becomes a boolean outline prop
  • formAction (the native button type) is now exposed as type (button/submit/reset)

Updated the button wrapper components, Storybook stories, README.md examples and BaseButton.test.js accordingly.

Why?

Fixes the confusion raised in review of #168, where a custom formAction prop was added because the existing type prop already meant "visual style" instead of the native button type.

Limitations and Notes

Breaking change, see the migration guide below.

How to migrate

  • Rename type (style) to variant
  • Remove variant="filled" (it's the default)
  • Replace variant="outline" with the boolean outline prop
  • Replace form-action="submit|reset|none" with type="submit|reset|button"
- <base-button type="primary" variant="outline" form-action="submit">
+ <base-button variant="primary" outline type="submit">
    Submit
  </base-button>

Applicable Issues

Closes #171

QA Log

  • pnpm run test:components: 530/530 tests passing
  • pnpm run type-check: no errors
  • pnpm storybook and manually checked the stories if everything renders correctly

Screenshots

No visual/CSS changes, only prop renames

@devmount devmount added the BREAKING This issue or PR contains a breaking change which requires a new major release. label Sep 25, 2026
@devmount devmount self-assigned this Sep 25, 2026

@davinotdavid davinotdavid 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.

LGTM after review comments! Thanks for the work, this will help reduce the confusion quite a bit.

Comment thread src/components/BaseButton.vue Outdated
Comment thread src/components/BaseButton.vue Outdated
@devmount
devmount merged commit dc8c558 into main Oct 5, 2026
5 checks passed
@devmount
devmount deleted the enhancements/171-restructure-button-component branch October 5, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING This issue or PR contains a breaking change which requires a new major release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor button properties

2 participants