Closed
Description
If we want to to let the label be before of the switch, we need:
<Flex
sx={{
justifyContent: 'space-between',
alignItems: 'center',
py: 4,
}}>
<Label htmlFor="enable-email-alerts" sx={{ flex: 1 }}>
Enable email alerts?
</Label>
<Box>
<Switch id="enable-email-alerts" />
</Box>
</Flex>
But I find that Switch is already a Label element. Why? I think this will be better:
<Label sx={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
py: 4,
}}>
<span>Enable email alerts?</span>
<Switch /> {/* A React.Fragment but not label element */}
</Label>
Metadata
Metadata
Assignees
Labels
No labels