Shura (mutual consultation) is clearly prescribed in the Qur'an, as follows:
وَالَّذِينَ اسْتَجَابُوا لِرَبِّهِمْ وَأَقَامُوا الصَّلَاةَ وَأَمْرُهُمْ شُورَىٰ بَيْنَهُمْ وَمِمَّا رَزَقْنَاهُمْ يُنفِقُونَ
And those who have responded to their lord and established prayer and whose affair is [determined by] consultation among themselves, and from what We have provided them, they spend. [42:38]
In particular, are there any examples from the sunnah where the prophet used shura for appointing rulers?