<TypographyControls
value={typography}
icons={{ bold, italic, underline, strike }}
labels={{
fontFamily: 'Font',
defaultFont: 'Default',
fontSize: 'Size',
typographySection: 'Text style',
bold: 'Bold',
italic: 'Italic',
underline: 'Underline',
strike: 'Strikethrough',
}}
onChange={(patch) =>
setTypography((value) => ({ ...value, ...patch }))
}
/>
<p
style={{
fontFamily: typography.fontFamily,
fontSize: typography.fontSize
? `${typography.fontSize}px`
: undefined,
fontWeight: typography.bold ? '700' : '400',
fontStyle: typography.italic ? 'italic' : 'normal',
textDecoration: [
typography.underline ? 'underline' : '',
typography.strike ? 'line-through' : '',
].join(' '),
}}
>
The quick brown fox
</p>