Repository navigation
feat!: narrow string props to bootstrap value unions - #5
Merged
Merged
Conversation
Props that map onto a fixed set of Bootstrap classes were typed as
`string`, so typos like `size="md"` compiled and rendered dead classes.
Theme colors and breakpoints stay open (`string & {}`) because they are
extensible via `$theme-colors` / `$grid-breakpoints`; they gain
autocomplete only.
BREAKING CHANGE: size, Spinner type, Placeholder animation, Navbar
fixed/sticky, Nav horizontal, List type and tooltip/popover trigger
props only accept Bootstrap's values. Callers passing a `string`
variable must narrow it (e.g. `as Size`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SimonSchick
marked this pull request as ready for review
November 18, 2026 06:06
Doridian
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Props that map onto a fixed set of Bootstrap classes were typed
string, so typos (size="md",fixed="left") compiled and rendered dead classes.Closed unions (breaking)
sizeonButton,DropdownToggle,ButtonGroup,Dropdown,InputGroup,Pagination,LabelSize('sm' | 'lg')Modal.size'sm' | 'lg' | 'xl'Table.size,Spinner.size'sm'Spinner.type'border' | 'grow'Placeholder.animation/size'glow' | 'wave'/'xs' | 'sm' | 'lg'Navbar.fixed/sticky'top' | 'bottom'Nav.horizontal'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'List.type'unstyled' | 'inline'triggeronTooltip,Popover,TooltipPopoverWrapperTrigger: up to three space-separated'click' | 'hover' | 'focus' | 'legacy' | 'manual'Open unions (non-breaking, autocomplete only)
Theme colors and breakpoints are Sass-extensible (
$theme-colors,$grid-breakpoints,Col/Rowwidths), so they keep(string & {}):ThemeColoron everycolorprop.Button/DropdownToggleadd'link';FormTextadds'muted' | 'body' | 'white' | ''.boolean | BreakpointforNavbar.expand,Nav.vertical,ListGroup.horizontal,Table.responsive,Container.fluid.Rowcols andColsize/order gain'auto'/'first' | 'last'.roleonModal,Offcanvas,ButtonGroup,ButtonToolbaris React'sAriaRole. That type is open too; oxlint'sjsx-a11y/aria-rolecatches invalid roles in JSX.Other
Modal.fullscreennow accepts'xxl'(modal-fullscreen-xxl-down).ThemeColor,Breakpoint,Size,TriggerandTriggerEventare exported from the barrel.src/__tests__/unions.tsxcovers accepted values, custom theme values and@ts-expect-errortypos. Two specs that passed nonsense sizes now use real ones.Migration
Callers passing a
stringvariable to a narrowed prop must narrow it, e.g.size={s as Size}. Literal JSX values that match Bootstrap need no change. This needs a major version (v12).Checks
lint, format:check, typecheck, test:ci (857 tests), build and build:docs all pass locally.
🤖 Generated with Claude Code