Skip to content

BBButton: add a full-width option and forward className #98

Closed

Description

@germanocaumo

Is your feature request related to a problem? Please describe.
BBButton sizes itself to its label (display: inline-flex), and a consumer can't change that:

  • It has no width prop.
  • It doesn't forward className or style to the <button>, so styled(BBButton) has no effect.
  • The label never wraps (white-space: nowrap), so a long translation overflows a fixed-width button instead of breaking onto two lines.

So a consumer that needs a button to fill a footer, a popover or a dialog row has to wrap it in a div and reach into it with a child selector. The BigBlueButton client now keeps a shared module of these wrappers (common/button-wrapper/styles.ts). The poll, timer and breakout panels use it, and more call sites are coming as other screens move to BBButton:

const FullWidthButtonWrapper = styled.div`
  display: flex;

  > * {
    width: 100%;
  }
`;

The wrappers depend on BBButton's DOM shape. A > * selector reaches the <button> only because it is the root element. In the stacked layout the root is a wrapper div, so the same rule sizes the wrong element.

Describe the solution you'd like

  • A fullWidth?: boolean prop: the button fills its container, with the label still centered.
  • Forward className (and ideally style) to the root element, so one-off layout needs work through styled(BBButton). Examples are a minimum width for short labels ("Pin", "Yes"), margins, or letting the label wrap.

Describe alternatives you've considered
Wrapper divs with child selectors, which is what the client does today. They work, but every consumer has to know the component's markup.

Affected component(s)
BBButton

Proposed API / Usage Example

<BBButton label="Share" fullWidth onClick={share} />

const FooterButton = styled(BBButton)`
  min-width: 8.5rem;
`;

Additional context
A minimum width for short labels is probably the consumer's choice rather than a library default. Forwarding className is enough for that.

Activity

  1. self-assigned this
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions