Files
react-test/docs/data/joy/components/chip/ChipVariables.js
how2ice 005cf56baf
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
init project
2025-12-12 14:26:25 +09:00

69 lines
1.7 KiB
JavaScript

import Avatar from '@mui/joy/Avatar';
import Box from '@mui/joy/Box';
import Chip from '@mui/joy/Chip';
import ChipDelete from '@mui/joy/ChipDelete';
import JoyVariablesDemo from 'docs/src/modules/components/JoyVariablesDemo';
export default function ChipVariables() {
return (
<JoyVariablesDemo
componentName="Chip"
renderCode={(formattedSx) => `<Chip
startDecorator={<Avatar />}
endDecorator={<ChipDelete />}${formattedSx ? `${formattedSx}>` : '\n>'}`}
data={[
{
var: '--Chip-minHeight',
defaultValue: '32px',
},
{
var: '--Chip-radius',
defaultValue: '24px',
},
{
var: '--Chip-gap',
defaultValue: '6px',
},
{
var: '--Chip-paddingInline',
defaultValue: '12px',
},
{
var: '--Chip-decoratorChildHeight',
defaultValue: '24px',
},
]}
renderDemo={(sx) => (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: 1,
}}
>
<Chip variant="soft" color="danger" sx={sx}>
Some text
</Chip>
<Chip
startDecorator={<Avatar src="/static/images/avatar/1.jpg" />}
endDecorator={<ChipDelete />}
sx={sx}
>
Person name
</Chip>
<Chip
variant="outlined"
color="neutral"
startDecorator={<Avatar src="/static/images/avatar/1.jpg" />}
endDecorator={<ChipDelete />}
sx={sx}
>
Person name
</Chip>
</Box>
)}
/>
);
}