from pytermgui import Button, Container, pretty, tim template = "[@primary #auto] {first} [@surface-1 #auto] {second} " def split_style(_: int, item: str) -> str: if "" not in item: return item first, second = item.split("") return tim.parse(template.format(first=first, second=second)) Button.styles.label = split_style Button.set_char("delimiter", [""] * 2) my_button = Button("HeyThere") pretty.print(my_button)