-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing props #478
Merged
Merged
Add missing props #478
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the examples from the docs 1. dmc.Center(inline=True) Makes it easy to align icons and textimport dash_mantine_components as dmc
from dash import Dash, _dash_renderer
from dash_iconify import DashIconify
_dash_renderer._set_react_version("18.2.0")
app = Dash(external_stylesheets=dmc.styles.ALL)
component = dmc.Box(
dmc.Anchor(
href="https://mantine.dev",
target="_blank",
children=dmc.Center(
[
DashIconify(
icon="tabler:arrow-left", # Use the Tabler Arrow Left icon
width=12,
height=12,
),
dmc.Box("Back to Mantine website", ml=5),
],
inline=True,
),
)
)
app.layout = dmc.MantineProvider(
component
)
if __name__ == "__main__":
app.run(debug=True, port=8052) 2. dmc.Avatar(allowedInitialsColors=["blue", "red"]) Can limit the number of colors to use in Avatar initialsimport dash_mantine_components as dmc
from dash import Dash, _dash_renderer
_dash_renderer._set_react_version("18.2.0")
app = Dash(external_stylesheets=dmc.styles.ALL)
names = [
'John Doe',
'Jane Mol',
'Alex Lump',
'Sarah Condor',
'Mike Johnson',
'Kate Kok',
'Tom Smith',
]
component = dmc.Group(
[dmc.Avatar(name=n, color="initials", allowedInitialsColors=["blue", "red"]) for n in names]
)
app.layout = dmc.MantineProvider(
component
)
if __name__ == "__main__":
app.run(debug=True, port=8052)
|
import dash_mantine_components as dmc
from dash_iconify import DashIconify
from dash import Dash, _dash_renderer
_dash_renderer._set_react_version("18.2.0")
app = Dash(external_stylesheets=dmc.styles.ALL)
styles_css = """
.dmc-api-demo-root {
border: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
border-radius: var(--mantine-radius-md);
font-weight: 500;
cursor: pointer;
&[data-checked] {
background-color: var(--mantine-color-blue-filled);
border-color: var(--mantine-color-blue-filled);
color: var(--mantine-color-white);
}
}"""
demo_py = """
import dash_mantine_components as dmc
dmc.Checkbox(
classNames={"root": "dmc-api-demo-root"},
label="Checkbox button",
w=180
)"""
code = [
{
"fileName": "demo.py",
"code": demo_py,
"language": "python",
"icon": DashIconify(icon="vscode-icons:file-type-reactts", width=20),
},
{
"fileName": "styles.css",
"code":styles_css,
"language": "css",
"icon": DashIconify(icon="vscode-icons:file-type-css", width=20),
},
]
component = dmc.CodeHighlightTabs(
code=code,
withExpandButton=True,
expandCodeLabel="Show full code",
collapseCodeLabel="Show less",
defaultExpanded=False,
maxCollapsedHeight=300
)
app.layout = dmc.MantineProvider(
component,
forceColorScheme="light"
)
if __name__ == "__main__":
app.run(debug=True)
|
Added import dash_mantine_components as dmc
from dash import Dash, _dash_renderer, Input, Output, State
_dash_renderer._set_react_version("18.2.0")
app = Dash(external_stylesheets=dmc.styles.ALL)
app.layout = dmc.MantineProvider(
dmc.PasswordInput(autoComplete="new-password")
)
if __name__ == "__main__":
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #428
open items for # 428
inline
prop toCenter
and updated docstring.allowedInitialsColors
toAvatar
defaultExpanded
toCodeHIghtlight
autoComplete
toPasswordInput
as requested in [Feature Request] Add autoComplete prop to PasswordInput #482