Skip to content

feat(SegmentedControl): allow for passing stricter type for options #7531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bvandercar-vt
Copy link
Contributor

Checklist

  • [N/A] Includes tests
  • Update documentation

Changes proposed in this pull request:

Allow for stricter type on SegmentedControl than just string, which reduces the need for type casting in many cases (ie the onChange callback).

You can still have just

<SegmentedControl

as before, for general string options, or you can have something like

<SegmentedControl<OptionsEnum>

to make sure that all passed option values, and the onChange, have the correct type.

Reviewers should focus on:

Improved type casting abilities, and mainly, the reduction of having to type cast with as.

Screenshot

No visual changes.

@changelog-app
Copy link

changelog-app bot commented Jul 31, 2025

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

feat(SegmentedControl): allow for passing stricter type for options


Generate changelog in packages/docs-app/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

feat(SegmentedControl): allow for passing stricter type for options


Generate changelog in packages/icons/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

feat(SegmentedControl): allow for passing stricter type for options


Check the box to generate changelog(s)

  • Generate changelog entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant