From 792ee34539f08c3d886dfddaeac4836f0981a86e Mon Sep 17 00:00:00 2001 From: Max Marcon Date: Thu, 26 Dec 2024 16:03:04 +0100 Subject: [PATCH] document selected field --- lib/live_select.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/live_select.ex b/lib/live_select.ex index 6cbc148..780dd0b 100644 --- a/lib/live_select.ex +++ b/lib/live_select.ex @@ -95,6 +95,9 @@ defmodule LiveSelect do ## Slots You can control how your options and tags are rendered by using the `:option` and `:tag` slots. + Both slots will be passed an option as argument. In the case of the `:option` slot, the option will have an + extra boolean field `:selected`, which will be set to `true` if the option has been selected by the user. + Let's say you want to show some fancy icons next to each option in the dropdown and the tags: ```elixir