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

Display indicator only #12

Open
atmediauk opened this issue Jun 26, 2019 · 2 comments
Open

Display indicator only #12

atmediauk opened this issue Jun 26, 2019 · 2 comments

Comments

@atmediauk
Copy link

Hello,

Is it possible to limit the toggle labels so that they are displayed on the forms but NOT on the index. Currently I have the following:

            Toggle::make('Status', 'status')
                ->showLabels()
                ->trueLabel('Published')
                ->falseLabel('Draft')
                ->trueValue('published')
                ->falseValue('draft'),

This works well and the labels are visible on the toggle form:

image

However due to limited space on the resource index I would like to remove the label (red boxes) so that only the indicator is shown:

image

I have been able to achieve this when I remove labels all together but would prefer not to do this.

Thank you for the package and your help, the package is really useful.

@davidpiesse
Copy link
Owner

Hi @atmediauk ,
This should be possible - it just needs a extra method to be added such as ->hideLabelOnIndex()

This would be a boolean that is also checked as to whether to show a label or not.
IndexField.vue needs a bit of extra logic to check for this.

If you could PR this then I can bring it in :)
Alas right now I might not get a chance till August to implement this myself.

D

@davidpiesse
Copy link
Owner

I am currently working on the new version for the latest upcoming Nova version (v4) which will use Vue 3; and I will be implementing Headless UI's toggle. https://headlessui.dev/vue/switch

This is something I will look into including in the package.

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

No branches or pull requests

2 participants