Py.Cafe

CNFeffery/

use-ant-design-component-token-in-fac

Ant Design Components in Dash

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import dash
from dash import html
import feffery_antd_components as fac

app = dash.Dash(__name__)

app.layout = html.Div(
    [
        fac.AntdConfigProvider(
            fac.AntdSpace(
                [
                    fac.AntdButton(
                        'Primary',
                        type='primary'
                    ),
                    fac.AntdConfigProvider(
                        fac.AntdButton(
                            'Default'
                        ),
                        token={
                            'borderRadius': 10,
                            'contentFontSize': 18
                        }
                    )
                ]
            ),
            token={
                'colorPrimary': '#00b96b',
                'borderRadius': 2,
                'colorBgContainer': '#f6ffed'
            }
        )
    ],
    style={
        'padding': 50
    }
)

if __name__ == '__main__':
    app.run()
requirements.txt
1
2
dash
feffery-antd-components