Change widgets appearance when they are created from a Parameterized class?

This should be easy to figure out but I haven’t been able to:

How do I customize the appearance of widgets created with panel.Param from a param.Parameterized class?

Specifically, I’m looking to make the ListSelector taller to display more options at a time:

import panel as pn
import param

class Test(param.Parameterized):
    full_list = param.List([1,2,3])
    selected_list = param.ListSelector([1,2,3], objects=[1,2,3])

    @param.depends("full_list", watch=True)
    def _list_auditlogs_in_selection(self):
        self.param['selected_list'].objects = self.full_list
        self.selected_list = self.full_list

Now if I supply selected_list a height argument, the height of the other widget (for full_list) changes too.

t = Test()

pn.Param(t.param, widgets={
    'selected_list': {'height': 1000},
})


It also leaves a lot of space below the two widgets (I’m not using extra line breaks between the screenshot and this line of text).

What is the correct way of supplying arguments to change widget properties when they are created from a Parameterized class?

which version of panel are you using?
Your code give me this output:

2 Likes