Space
import { Grid, View, useTheme } from '@aws-amplify/ui-react';
export const SpaceExample = () => {
const { tokens } = useTheme();
return (
<Grid gap={tokens.space.xxl} templateColumns="1fr 1fr">
<View
padding={tokens.space.medium}
backgroundColor={tokens.colors.neutral[20]}
></View>
<View
padding={tokens.space.medium}
backgroundColor={tokens.colors.neutral[20]}
></View>
</Grid>
);
};
.custom-grid {
gap: var(--amplify-space-xxl);
}
.custom-view {
padding: var(--amplify-space-medium);
}
- zero
- xxxs
- xxs
- xs
- small
- medium
- large
- xl
- xxl
- xxxl
- relative.xxxs
- relative.xxs
- relative.xs
- relative.small
- relative.medium
- relative.large
- relative.xl
- relative.xxl
- relative.xxxl
- relative.full
Border Widths
import { Button, useTheme, ThemeProvider } from '@aws-amplify/ui-react';
export const BorderWidthExample = () => {
const { tokens } = useTheme();
const theme = {
name: 'custom-theme',
tokens: {
components: {
button: {
borderWidth: tokens.borderWidths.large,
},
},
},
};
return (
<ThemeProvider theme={theme}>
<Button color={tokens.colors.secondary[60]}>Custom border button</Button>
</ThemeProvider>
);
};
.custom-button {
border-width: var(--amplify-border-widths-large);
}
- small
- medium
- large
Radii
Text
import { Card, useTheme } from '@aws-amplify/ui-react';
export const RadiiExample = () => {
const { tokens } = useTheme();
return (
<Card
borderRadius={tokens.radii.xxxl}
backgroundColor={tokens.colors.green[10]}
>
Text
</Card>
);
};
.custom-card {
border-radius: var(--amplify-radii-xxxl);
}
- xs
- small
- medium
- large
- xl
- xxl
- xxxl