Skip to content

Commit

Permalink
Button for forms UX improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-Flath committed Oct 24, 2024
1 parent 12f0662 commit 7cc0a48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fh_frankenui/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ def _generate_next_value_(name, start, count, last_values): return str2ukcls('bu
# %% ../lib_nbs/01_core.ipynb
def Button(*c: Union[str, FT],
cls: Union[str, Enum]=ButtonT.default,
submit=True
**kwargs
) -> FT:
"A Button with Styling"
return fh.Button(*c, cls=('uk-button', stringify(cls)), type='button', **kwargs)
return fh.Button(*c, cls=('uk-button', stringify(cls)), type='submit' if submit else 'button', **kwargs)

# %% ../lib_nbs/01_core.ipynb
def ButtonSubmit(*c: Union[str, FT],
Expand Down
3 changes: 2 additions & 1 deletion lib_nbs/01_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,11 @@
"#| export\n",
"def Button(*c: Union[str, FT],\n",
" cls: Union[str, Enum]=ButtonT.default,\n",
" submit=True\n",
" **kwargs\n",
" ) -> FT:\n",
" \"A Button with Styling\"\n",
" return fh.Button(*c, cls=('uk-button', stringify(cls)), type='button', **kwargs)"
" return fh.Button(*c, cls=('uk-button', stringify(cls)), type='submit' if submit else 'button', **kwargs)"
]
},
{
Expand Down

0 comments on commit 7cc0a48

Please sign in to comment.