Files
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

39 lines
1019 B
TypeScript

import * as React from 'react';
import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
export default function DynamicValues() {
const [color, setColor] = React.useState('#007fff');
return (
<Stack spacing={1} sx={{ alignItems: 'center' }}>
<Typography
component="label"
variant="body2"
sx={{ display: 'inline-flex', alignItems: 'center', gap: 1 }}
>
Pick a color to see a live preview
<input
type="color"
value={color}
onChange={(event) => setColor(event.target.value)}
/>
</Typography>
<Box
component="div"
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: 75,
height: 75,
borderRadius: 2,
backgroundColor: 'var(--bg)',
}}
style={{ '--bg': color } as React.CSSProperties}
/>
</Stack>
);
}