1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-18 03:41:35 +02:00

Add button with icon

This commit is contained in:
Phuoc Nguyen
2019-11-17 10:29:57 +07:00
parent f43797f4e9
commit 6393b96e84
4 changed files with 108 additions and 23 deletions

View File

@@ -0,0 +1,56 @@
import React from 'react';
import DetailsLayout from '../DetailsLayout';
import Dot from '../placeholders/Dot';
import BrowserFrame from '../placeholders/BrowserFrame';
import Rectangle from '../placeholders/Rectangle';
import SampleCode from '../SampleCode';
import useDocumentTitle from '../useDocumentTitle';
const ButtonWithIcon = () => {
useDocumentTitle('CSS Layout ∙ Button with icon');
return (
<DetailsLayout>
<h1 className="f1 tc">Button with icon</h1>
<BrowserFrame
content={
<div className="h-100 flex flex-column items-center justify-center">
<div className="w5">
<div className="w-100 h3 flex flex-row items-center ba b--black-30 br2 ph2">
<div className="mr2"><Dot size={32} /></div>
<Rectangle />
</div>
</div>
</div>
}
source={
<SampleCode
lang="html"
code={`
<div style="
/* Content is centered */
align-items: center;
display: flex;
justify-content: center;
/* Colors */
background-color: rgba(0, 0, 0, .3);
color: #FFF;
/* Rounded border */
border-radius: 9999px;
height: 32px;
width: 32px;
">
1
</div>
`}
/>
}
/>
</DetailsLayout>
);
};
export default ButtonWithIcon;