Skip to content
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

SegmentedControl element #3111

Closed
shuyangli opened this issue Nov 1, 2018 · 0 comments · Fixed by #6454
Closed

SegmentedControl element #3111

shuyangli opened this issue Nov 1, 2018 · 0 comments · Fixed by #6454

Comments

@shuyangli
Copy link
Contributor

Feature request

Would be great to have a prepackaged SegmentedControl component, instead of requiring consumers to roll their own. Something like this:

export class AlignmentSelect extends React.PureComponent<IAlignSelectProps> {
public render() {
const { align, allowCenter = true, label = "Align text" } = this.props;
return (
<div>
{label}
<ButtonGroup fill={true} style={{ marginTop: 5 }}>
<Button active={align === Alignment.LEFT} text="Left" onClick={this.handleAlignLeft} />
{allowCenter && (
<Button
active={align == null || align === Alignment.CENTER}
text="Center"
onClick={this.handleAlignCenter}
/>
)}
<Button active={align === Alignment.RIGHT} text="Right" onClick={this.handleAlignRight} />
</ButtonGroup>
</div>
);
}

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

Successfully merging a pull request may close this issue.

3 participants