Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import * as React from 'react';
|
|
import Button from '@mui/joy/Button';
|
|
import IconButton from '@mui/joy/IconButton';
|
|
import Stack from '@mui/joy/Stack';
|
|
import FormatBold from '@mui/icons-material/FormatBold';
|
|
|
|
export default function ToggleButtons() {
|
|
const [pressed, setPressed] = React.useState(false);
|
|
return (
|
|
<Stack spacing={2} direction="row">
|
|
<Button
|
|
variant="outlined"
|
|
color="neutral"
|
|
onClick={() => setPressed(!pressed)}
|
|
aria-pressed={pressed ? 'true' : 'false'}
|
|
sx={(theme) => ({
|
|
[`&[aria-pressed="true"]`]: {
|
|
...theme.variants.outlinedActive.neutral,
|
|
borderColor: theme.vars.palette.neutral.outlinedHoverBorder,
|
|
},
|
|
})}
|
|
>
|
|
Button
|
|
</Button>
|
|
<IconButton
|
|
variant="outlined"
|
|
color="neutral"
|
|
onClick={() => setPressed(!pressed)}
|
|
aria-pressed={pressed ? 'true' : 'false'}
|
|
sx={(theme) => ({
|
|
[`&[aria-pressed="true"]`]: {
|
|
...theme.variants.outlinedActive.neutral,
|
|
borderColor: theme.vars.palette.neutral.outlinedHoverBorder,
|
|
},
|
|
})}
|
|
>
|
|
<FormatBold />
|
|
</IconButton>
|
|
</Stack>
|
|
);
|
|
}
|