Skip to content

[feat] DsfrCardTileListCmp - Allow default sort direction configuration #9

Description

@Matthieu-Jarry

Is your feature request related to a problem? Please describe.
Currently, the DsfrCardTileListCmp component always defaults to sorting in ascending (Asc) order. This becomes limiting when specific fields would benefit more from being displayed in descending (Desc) order by default (e.g., dates).

Describe the solution you'd like
I'd like the component to support a configuration option that allows specifying the default sort direction (either Asc or Desc) per field. This would make the component more flexible and aligned with different sorting needs.

Describe alternatives you've considered
No viable alternatives have been identified.

Additional context

Image

As shown in the attached screenshot, we have a real use case where finished professional interviews ("entretiens professionnel et de formation terminés") are listed and sorted by year. In this case, the most recent items (e.g., year 2025) should appear first. A descending sort by default is expected, but the component forces ascending order, which results in the newest items being pushed to the bottom. Being able to set Desc as the default would resolve this and improve user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions