Skip to content

Comments

[MISC] Add Multistate Chip#2148

Open
acrowthe wants to merge 2 commits intodevfrom
misc-multistate-chip
Open

[MISC] Add Multistate Chip#2148
acrowthe wants to merge 2 commits intodevfrom
misc-multistate-chip

Conversation

@acrowthe
Copy link
Contributor

@acrowthe acrowthe commented Dec 18, 2025

Add a chip that can be clicked to cycle between multiple different values and appearances

Here's an example test snippet, I pasted it at the top of live table but putting it into any component that's easy to access should work for testing:

      <TriStateChip
        label="Test Chip"
        defaultTooltip="Include/Exclude"
        positiveTooltip="Include"
        onChange={(value) => console.log(value)}
      />
      

}
}, [states])

return <Tooltip title={states[currentStateIndex]?.tooltip}>
Copy link
Contributor

@marta- marta- Dec 22, 2025

Choose a reason for hiding this comment

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

Only render the chip if we have states. Also there will be a warning if for any reason the tooltip is missing, are we making tooltips required, should we allow them to be absent and not render the tooltip in that case (tedious!) or should we us some sort of default?

Suggested change
return <Tooltip title={states[currentStateIndex]?.tooltip}>
return states?.length > 0 &&
<Tooltip title={states[currentStateIndex]?.tooltip ?? "Click to change"}>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not seeing any sort of error if tooltip gets a null or undefined title - it just silently displays nothing. I've flagged the labels as required props anyways

Add a chip that can be clicked to cycle between multiple different values and appearances
@acrowthe acrowthe force-pushed the misc-multistate-chip branch from 480090c to 88480ff Compare February 5, 2026 18:06
Code cleanup and improved error cases
- Move tri state chip into seperate component file
- Improve handling of cases where data is missing eg. undefined states
- Improve property definition to simplify passing properties down to chip
@acrowthe acrowthe force-pushed the misc-multistate-chip branch from 88480ff to 48120dc Compare February 5, 2026 18:21
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.

3 participants