# Rendering task states in a query

**URL:** https://community.silverbullet.md/t/rendering-task-states-in-a-query/3621
**Category:** Lua
**Created:** [December 6, 2025, 12:40am UTC](https://community.silverbullet.md/t/rendering-task-states-in-a-query/3621 "2025-12-06T00:40:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![oxmhpark](https://community.silverbullet.md/user_avatar/community.silverbullet.md/oxmhpark/32/2320_2.png) [@oxmhpark](https://community.silverbullet.md/u/oxmhpark)
#### Post date: [December 6, 2025, 12:40am UTC](https://community.silverbullet.md/t/rendering-task-states-in-a-query/3621/1 "2025-12-06T00:40:18Z")

</div>

Hi, I’ve wrote a query like:

```space-lua
# Checklist
${query[[
  from item = index.tag "task"
  where
    table.includes(item.itags, "project")
    and not item.done
  order by
    item.page,
    item.pos
  select {
    state = "[" .. item.state .. "]",
    ref = item.ref,
    name = item.name
  }
]]}

```

And it shows:

 ![Screenshot 2025-12-06 093151](https://community.silverbullet.md/uploads/default/original/2X/7/71f426988da12e22406c5a1789b6cedc8e3d204e.png)

… Yes, I’m not using `taskItem` template, because I prefer the table form than the list.

How can i render `state` columns as checkboxes?

---

<div class="post-metadata">

### Author: ![Krishna-Sivakumar](https://community.silverbullet.md/user_avatar/community.silverbullet.md/krishna-sivakumar/32/2262_2.png) [@Krishna-Sivakumar](https://community.silverbullet.md/u/Krishna-Sivakumar)
#### Post date: [December 6, 2025, 3:18pm UTC](https://community.silverbullet.md/t/rendering-task-states-in-a-query/3621/2 "2025-12-06T15:18:03Z")

</div>

~~HTML input checkbox widget, with the checked attribute being `item.state`~~  
EDIT: rendering elements doesn’t work as expected with the default tables… you’d probably have to render it out yourself

---

<div class="post-metadata">

### Author: ![oxmhpark](https://community.silverbullet.md/user_avatar/community.silverbullet.md/oxmhpark/32/2320_2.png) [@oxmhpark](https://community.silverbullet.md/u/oxmhpark)
#### Post date: [December 6, 2025, 5:38pm UTC](https://community.silverbullet.md/t/rendering-task-states-in-a-query/3621/3 "2025-12-06T17:38:43Z")

</div>

I’ve yielded rendering to a function for the future:

```auto
...
  select {
    state = RenderCheckbox(item)
...

```

```auto
function(task)
  return "[" .. task.state .. "]"
end

```
