Skip to content
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

feat: add header button #35

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bartlomiej-przymus
Copy link

@bartlomiej-przymus bartlomiej-przymus commented May 3, 2024

1️⃣ Is this something that is wanted/needed? Did you create an issue / discussion about it first?

Yes I did. Related Issue: #34

2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.

Nope.

3️⃣ Does it include tests, if possible? (Not a deal-breaker, just a nice-to-have)

Yes, I have Included test to check new functionality

4️⃣ Please include a thorough description of the improvement and reasons why it's useful.

This PR adds new Headers dropdown button to allow users to set headers in edited text:

Screenshot 2024-05-03 at 20 25 26

This PR introduces new enum ToolbarButton::Header that can be used inside toolbarButtons([]) method to add new button to toolbar.

We can also control available header sizes by passing array of header sizes to new setHeaders() method.

QuillEditor::make('value')
    ->toolbarButtons([
        ToolbarButton::Header,
    ])
    ->setHeaders(['1', '2', false]),

will produce following:
Screenshot 2024-05-03 at 20 19 32

The false in array stands for Normal text.

5️⃣ Thanks for contributing! 🙌

@makkinga
Copy link

I need this functionality in my project.

@rawilk can this please be implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants