Trix: Possible to disable default toolbar and create a custom one

Created on 17 Oct 2015  路  8Comments  路  Source: basecamp/trix

Excited this is finally out. Is it possible to disable the toolbar injected and and use a custom one?

I created my own here: http://codepen.io/souporserious/pen/dYZVYo?editors=100 would be nice to have an option to not render the toolbar at all.

Most helpful comment

would be nice to have an option to not render the toolbar at all.

Set the toolbar attribute to your own element and Trix will use it rather than providing its own: <trix-editor toolbar="toolbar-dom-id"></trix-editor>

All 8 comments

+1

+1

Really, you can accomplish a custom toolbar with custom CSS. A couple buttons that I didn't want for my use case can be easily hidden. So I guess a detract my +1 :smile:

/* SCSS file */

trix-toolbar .button_groups {
  button.code {
    display: none;
  }
  button.increase {
    display: none;
  }
  button.decrease {
    display: none;
  }
}

@jwilsjustin that doesn't give you the ability to add custom buttons with an arbitrary callback function.

Sure, you could just inject the DOM objects and bind your own event listeners, but that's a very blunt tool. What this ticket is requesting is something a little more elegant.

would be nice to have an option to not render the toolbar at all.

Set the toolbar attribute to your own element and Trix will use it rather than providing its own: <trix-editor toolbar="toolbar-dom-id"></trix-editor>

It's great that this can be done, but it doesn't appear to be documented anywhere outside this ticket... or am I missing it somewhere?

Nice! Yes, wasn't able to find this anywhere either. Thanks for posting, maybe the readme needs an update?

Hello everyone. Any help here? --> https://github.com/basecamp/trix/issues/115#issuecomment-160343141 Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benzkji picture benzkji  路  3Comments

madikarizma picture madikarizma  路  5Comments

lanzhiheng picture lanzhiheng  路  4Comments

lcsqlpete picture lcsqlpete  路  3Comments

divyenduz picture divyenduz  路  3Comments