Filament: 3 Quick Tips to Make Forms Take Less Space

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024
  • A few simple "tricks" to position form elements in a way they would not take so much screen space.
    Original example with shipping/billing: filamentexampl...

Комментарии • 21

  • @mcf1110
    @mcf1110 4 месяца назад +11

    Just keep in mind that hiding the label is usually a bad idea for the accessibility of the form:
    - Screen readers usually have a hard time with placeholders, and they rely on the label to identity the field to the user
    - Also, suppose you are editing the form. You'd have no idea which field is which, as the placeholders would be hidden and you'd only see the data. I guess on the example it is pretty obvious, since the format of the data you'd fill in is a giveaway. But still, probably not a great idea.

    • @ricko13
      @ricko13 4 месяца назад +2

      facts 💯

    • @latlov
      @latlov 4 месяца назад +3

      Instead of using the placeholders, how about placing the labels in the same level or to the left of the input text? Because placing labels above the text inputs use a lot of space of the form. And placeholders are hard to read. I've seen people confuse the placeholders with text already saved in the forms. I agree that placeholders have UX caveats.

  • @Voltra_
    @Voltra_ 4 месяца назад +8

    I'd also split the fields (e.g. City and zip code on the same line, same for first name and last name). I personally prefer to leave the labels, even if they're the same as the placeholders

  • @АртурЗарипов-б2й
    @АртурЗарипов-б2й Месяц назад

    Thank you very much!

  • @georgezimmer5622
    @georgezimmer5622 4 месяца назад

    I don't like to replace labels with placeholders because of accessibility issues. I prefer the flowbite approach with the label inside that move up a bit when the field is focused / filled. Their inputs fields are really well done.

  • @GasparSukk
    @GasparSukk 4 месяца назад +4

    1. How do you solve *required indicators (default asterisk colored red in the label)?
    2. Can you move "Same as billing" into header of the form (right side next to "Shipping Details")?

    • @FilamentDaily
      @FilamentDaily  4 месяца назад +3

      Interesting questions, need to think, experiment and shoot future videos :)

  • @JAOcero
    @JAOcero 4 месяца назад +1

    We have also ->compact() to lessen padding and spacing

  • @_codewithabhi
    @_codewithabhi 4 месяца назад

    Great Tutorials. How do I show the create form on the left and the table on the right in the filament? if there is any example do share

    • @FilamentDaily
      @FilamentDaily  4 месяца назад +1

      That would require a separate Livewire component that would use both forms and tables from Filament.
      I don't have an example, maybe worth creating, will add to list of ideas.
      Alternatively, maybe check Simple Resources that use modal forms?

  • @lawrencesmith7436
    @lawrencesmith7436 4 месяца назад

    How does one reduce the space between the panel items and the form/table? I find that it wastes so much space, especially on larger screens.

  • @galegobr1
    @galegobr1 4 месяца назад +2

    How to reduce padding into forms?

  • @parthibarath6092
    @parthibarath6092 4 месяца назад

    Can you please do the video to do how to show the records in table format inside modal?

    • @FilamentDaily
      @FilamentDaily  4 месяца назад

      Can you give a specific example of a use-case?
      But also, a similar example we covered here: filamentexamples.com/project/filament-repeater-items-from-filtered-table-list

    • @parthibarath6092
      @parthibarath6092 4 месяца назад

      @@FilamentDaily Thanks for the reply. Actually i showed the hasMany Relation records in repeatable entry in infolist in view modal in resources but i don't know how to show that records in table format

    • @FilamentDaily
      @FilamentDaily  4 месяца назад

      @@parthibarath6092 I haven't implemented exact case of infolist and repeatable entry, sorry don't have the answer for you

  • @vinayakdevc6
    @vinayakdevc6 4 месяца назад

    thumbsup reaction at 2:45

  • @user85937
    @user85937 4 месяца назад +1

    So we leave the long ass fields like that in "Your details"?

    • @FilamentDaily
      @FilamentDaily  4 месяца назад +1

      You can shorten them as well, I just showed the principle that you can use for any form sections or full form. The goal was not to shorten all the full form on the screen.