1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-24 03:06:22 +02:00
Files
csslayout/pages/button-with-icon/index.tsx
2021-10-14 20:01:13 +07:00

74 lines
2.5 KiB
TypeScript

import * as React from 'react';
import Head from 'next/head';
import { Pattern } from '../../constants/Pattern';
import { PatternLayout } from '../../layouts/PatternLayout';
import BrowserFrame from '../../placeholders/BrowserFrame';
import Circle from '../../placeholders/Circle';
import Rectangle from '../../placeholders/Rectangle';
const Details: React.FC<{}> = () => {
return (
<PatternLayout pattern={Pattern.ButtonWithIcon}>
<Head>
<meta name="description" content="Create an icon button with CSS flexbox" />
<meta name="og:description" content="Create an icon button with CSS flexbox" />
<meta name="twitter:description" content="Create an icon button with CSS flexbox" />
<meta name="keywords" content="css flexbox, css icon button" />
</Head>
<BrowserFrame
html={`
<button class="button">
<!-- Icon -->
...
<!-- Label -->
...
</button>
`}
css={`
.button {
/* Center the content */
align-items: center;
display: flex;
flex-direction: row;
justify-content: center;
}
`}
>
<div
style={{
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
height: '100%',
justifyContent: 'center',
padding: '8px',
}}
>
<div style={{ width: '256px' }}>
<button
style={{
alignItems: 'center',
border: '1px solid rgba(0, 0, 0, 0.3)',
borderRadius: '8px',
display: 'flex',
height: '64px',
padding: '8px',
width: '100%',
}}
>
<div style={{ marginRight: '8px' }}>
<Circle size={32} />
</div>
<Rectangle />
</button>
</div>
</div>
</BrowserFrame>
</PatternLayout>
);
};
export default Details;