Skip to content

Adding a Button to Change Text Color in ui.editor Toolbar #3575

Closed Answered by python-and-fiction
Daniel-Fei asked this question in Q&A
Discussion options

You must be logged in to vote

@falkoschindler Thank your method, I get the final solution.
Here is:

with ui.editor().props(''':toolbar="[['left','center','right','justify'],['bold','italic','underline','strike'], ['undo','redo'],['color','save']]"''').classes('w-[480px]') as editor: 
    with editor.add_slot("save"):
        with ui.button(icon="save",on_click=lambda:ui.notify(f'{len(editor.value)} chars saved!')).props("flat dense size=0.8em").classes("text-black p-0"):
            ui.tooltip('Save text').props('delay=1200 transition-duration=300')
    with editor.add_slot("color"):
        with ui.icon('colorize',size='1.2em').classes("text-black p-0"):
            ui.tooltip('Change color').props('delay=1200 transi…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@python-and-fiction
Comment options

Answer selected by Daniel-Fei
@Daniel-Fei
Comment options

@Daniel-Fei
Comment options

@python-and-fiction
Comment options

@Daniel-Fei
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants